1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Print a warning if we fail to retrieve the process name for any reason.

This commit is contained in:
Christian S.J. Peron 2005-09-13 23:11:16 +00:00
parent 15f3d81f9c
commit 6f798df578
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150114

View File

@ -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));
}