aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/sockstat
diff options
context:
space:
mode:
authorGiorgos Keramidas <keramida@FreeBSD.org>2006-11-12 19:03:39 +0000
committerGiorgos Keramidas <keramida@FreeBSD.org>2006-11-12 19:03:39 +0000
commitd2d77d2aeec7b84f7205134f87f2409d8d543e03 (patch)
tree8ce15ab6814291970674a29fe7b052c4b2db8576 /usr.bin/sockstat
parent9167cd6392c26447fdc8c933b107298d2cae8fbf (diff)
Notes
Diffstat (limited to 'usr.bin/sockstat')
-rw-r--r--usr.bin/sockstat/sockstat.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index f128d38a5004..bd71c5352f92 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -713,17 +713,12 @@ main(int argc, char *argv[])
if (argc > 0)
usage();
- /*
- * If protos_defined remains -1, no -P was provided, so we have to
- * set up the default protocol list in protos[] first.
- */
- if (!opt_4 && !opt_6 && !opt_u && protos_defined == -1) {
- opt_u = 1;
- protos_defined = set_default_protos();
- }
-
- if (!opt_4 && !opt_6)
+ if ((!opt_4 && !opt_6) && protos_defined != -1)
opt_4 = opt_6 = 1;
+ if (!opt_4 && !opt_6 && !opt_u)
+ opt_4 = opt_6 = opt_u = 1;
+ if ((opt_4 || opt_6) && protos_defined == -1)
+ protos_defined = set_default_protos();
if (!opt_c && !opt_l)
opt_c = opt_l = 1;