When querying a process's umask via sysctl in libprocstat(), don't
print a warning if EPERM is returned as this is an expected failure mode rather than error -- similar to current handling of ESRCH. This makes the output of 'procstat -as' vastly more palatable. MFC after: 3 days Sponsored by: DARPA, AFRL
This commit is contained in:
parent
c34a97a05d
commit
09b46be1cd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=262690
@ -2052,7 +2052,7 @@ procstat_getumask_sysctl(pid_t pid, unsigned short *maskp)
|
|||||||
mib[3] = pid;
|
mib[3] = pid;
|
||||||
len = sizeof(*maskp);
|
len = sizeof(*maskp);
|
||||||
error = sysctl(mib, 4, maskp, &len, NULL, 0);
|
error = sysctl(mib, 4, maskp, &len, NULL, 0);
|
||||||
if (error != 0 && errno != ESRCH)
|
if (error != 0 && errno != ESRCH && errno != EPERM)
|
||||||
warn("sysctl: kern.proc.umask: %d", pid);
|
warn("sysctl: kern.proc.umask: %d", pid);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user