summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2005-09-13 23:11:16 +0000
committercsjp <csjp@FreeBSD.org>2005-09-13 23:11:16 +0000
commit68a7460967aa5232683322c896b956119875e62f (patch)
treecdc8efcc1319f22a1591074e15bee6550b22214d /usr.bin
parent5a87a7f523c3dfdcd3a44b066eaf8016271655e0 (diff)
downloadFreeBSD-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.c4
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));
}
OpenPOWER on IntegriCloud