diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-30 15:42:53 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-31 13:18:54 +0100 |
commit | 6da9b2397b6ed81c8d73d040a10543330af4659b (patch) | |
tree | d3930e0973052defe663ad6a77e3d2cd61a540fb /freebsd/usr.bin/netstat/inet.c | |
parent | NETSTAT(1): Fix isalpha() and isdigit() usage (diff) | |
download | rtems-libbsd-6da9b2397b6ed81c8d73d040a10543330af4659b.tar.bz2 |
NETSTAT(1): Initialize global variables
Use BSD program lock.
Diffstat (limited to 'freebsd/usr.bin/netstat/inet.c')
-rw-r--r-- | freebsd/usr.bin/netstat/inet.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/freebsd/usr.bin/netstat/inet.c b/freebsd/usr.bin/netstat/inet.c index 5a414592..4915a4dd 100644 --- a/freebsd/usr.bin/netstat/inet.c +++ b/freebsd/usr.bin/netstat/inet.c @@ -306,7 +306,6 @@ void protopr(u_long off, const char *name, int af1, int proto) { int istcp; - static int first = 1; char *buf; const char *vchar; struct tcpcb *tp = NULL; @@ -394,7 +393,7 @@ protopr(u_long off, const char *name, int af1, int proto) )) continue; - if (first) { + if (!protopr_initialized) { if (!Lflag) { printf("Active Internet connections"); if (aflag) @@ -424,7 +423,7 @@ protopr(u_long off, const char *name, int af1, int proto) else printf("(state)\n"); } - first = 0; + protopr_initialized = 1; } if (Lflag && so->so_qlimit == 0) continue; @@ -913,7 +912,7 @@ arp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) -static const char *icmpnames[ICMP_MAXTYPE + 1] = { +static const char *const icmpnames[ICMP_MAXTYPE + 1] = { "echo reply", /* RFC 792 */ "#1", "#2", |