diff options
author | csjp <csjp@FreeBSD.org> | 2005-09-13 23:11:16 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2005-09-13 23:11:16 +0000 |
commit | 68a7460967aa5232683322c896b956119875e62f (patch) | |
tree | cdc8efcc1319f22a1591074e15bee6550b22214d /usr.bin | |
parent | 5a87a7f523c3dfdcd3a44b066eaf8016271655e0 (diff) | |
download | FreeBSD-src-68a7460967aa5232683322c896b956119875e62f.zip FreeBSD-src-68a7460967aa5232683322c896b956119875e62f.tar.gz |
Print a warning if we fail to retrieve the process name for any reason.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/netstat/bpf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/netstat/bpf.c b/usr.bin/netstat/bpf.c index c5d197d..e73da68 100644 --- a/usr.bin/netstat/bpf.c +++ b/usr.bin/netstat/bpf.c @@ -61,8 +61,10 @@ bpf_pidname(pid_t pid) mib[3] = pid; size = sizeof(newkp); error = sysctl(mib, 4, &newkp, &size, NULL, 0); - if (error < 0) + if (error < 0) { + warn("kern.proc.pid failed"); return (strdup("??????")); + } return (strdup(newkp.ki_comm)); } |