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:
Maxim Konovalov 2007-06-16 20:24:55 +00:00
parent ff9d7fae6a
commit 48c513e07f

View File

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