summaryrefslogtreecommitdiffstats
path: root/usr.bin/sockstat
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2015-07-17 08:37:13 +0000
committerdes <des@FreeBSD.org>2015-07-17 08:37:13 +0000
commit8e2e593b27def67b900d34dd3cbd7aa5e6cba977 (patch)
treec4b49df0150048138f79c890190c218bd75ea075 /usr.bin/sockstat
parentef3b83d350a070a0a62158135194471d96b1e4f8 (diff)
downloadFreeBSD-src-8e2e593b27def67b900d34dd3cbd7aa5e6cba977.zip
FreeBSD-src-8e2e593b27def67b900d34dd3cbd7aa5e6cba977.tar.gz
Move assignments around to avoid a false-positive uninitialized variable
warning which broke the sparc64 build. PR: 201585 MFC after: 3 weeks
Diffstat (limited to 'usr.bin/sockstat')
-rw-r--r--usr.bin/sockstat/sockstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index b7ad618..2861254 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -598,9 +598,10 @@ gather_inet(int proto)
xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len);
if (xig >= exig)
break;
+ xip = (struct xinpcb *)xig;
+ xtp = (struct xtcpcb *)xig;
switch (proto) {
case IPPROTO_TCP:
- xtp = (struct xtcpcb *)xig;
if (xtp->xt_len != sizeof(*xtp)) {
warnx("struct xtcpcb size mismatch");
goto out;
@@ -612,7 +613,6 @@ gather_inet(int proto)
break;
case IPPROTO_UDP:
case IPPROTO_DIVERT:
- xip = (struct xinpcb *)xig;
if (xip->xi_len != sizeof(*xip)) {
warnx("struct xinpcb size mismatch");
goto out;
OpenPOWER on IntegriCloud