svn commit: r262690 - head/lib/libprocstat
Robert Watson
rwatson at FreeBSD.org
Sun Mar 2 13:26:09 UTC 2014
Author: rwatson
Date: Sun Mar 2 13:26:08 2014
New Revision: 262690
URL: http://svnweb.freebsd.org/changeset/base/262690
Log:
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
Modified:
head/lib/libprocstat/libprocstat.c
Modified: head/lib/libprocstat/libprocstat.c
==============================================================================
--- head/lib/libprocstat/libprocstat.c Sun Mar 2 13:12:06 2014 (r262689)
+++ head/lib/libprocstat/libprocstat.c Sun Mar 2 13:26:08 2014 (r262690)
@@ -2052,7 +2052,7 @@ procstat_getumask_sysctl(pid_t pid, unsi
mib[3] = pid;
len = sizeof(*maskp);
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);
return (error);
}
More information about the svn-src-all
mailing list