o Do not warn if the process exits before we get its name.
PR: bin/113777 Submitted by: Dmitrij Tejblum MFC after: 1 week
This commit is contained in:
parent
ff9d7fae6a
commit
48c513e07f
@ -526,7 +526,9 @@ getprocname(pid_t pid)
|
||||
mib[3] = (int)pid;
|
||||
len = sizeof proc;
|
||||
if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) {
|
||||
warn("sysctl()");
|
||||
/* Do not warn if the process exits before we get its name. */
|
||||
if (errno != ESRCH)
|
||||
warn("sysctl()");
|
||||
return ("??");
|
||||
}
|
||||
return (proc.ki_comm);
|
||||
|
Loading…
Reference in New Issue
Block a user