diff options
author | jmg <jmg@FreeBSD.org> | 2003-07-19 06:23:56 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2003-07-19 06:23:56 +0000 |
commit | 32109862159d0d4e468125c26efe4a2f828a6406 (patch) | |
tree | 854ceb153c2864141860f78830d4ff9a7bce6c3c /usr.bin/sockstat | |
parent | 92d5461b30d97eeb3b75288cb5ae2b645f0dc4af (diff) | |
download | FreeBSD-src-32109862159d0d4e468125c26efe4a2f828a6406.zip FreeBSD-src-32109862159d0d4e468125c26efe4a2f828a6406.tar.gz |
make sockstat not print wierd addresses on not connected unix domain sockets
Pointed out by: rwatson
Reviewed by: peter
Diffstat (limited to 'usr.bin/sockstat')
-rw-r--r-- | usr.bin/sockstat/sockstat.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index b68906e..eaeb242 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -540,8 +540,12 @@ display(void) break; } /* client */ - pos += xprintf("-> "); p = *(void **)&s->faddr; + if (p == NULL) { + pos += xprintf("(not connected)"); + break; + } + pos += xprintf("-> "); for (hash = 0; hash < HASHSIZE; ++hash) { for (s = sockhash[hash]; s != NULL; s = s->next) if (s->pcb == p) |