diff options
author | rwatson <rwatson@FreeBSD.org> | 2014-03-02 13:26:08 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2014-03-02 13:26:08 +0000 |
commit | d533359f746120b2687173cb69c7e3e7d43cf3bc (patch) | |
tree | 78832b2bb17e24337317a7d5e9350a98e96c357a /lib/libprocstat | |
parent | 6c0aa10090c213b20b94e5af8db9a6f9d07e27cc (diff) | |
download | FreeBSD-src-d533359f746120b2687173cb69c7e3e7d43cf3bc.zip FreeBSD-src-d533359f746120b2687173cb69c7e3e7d43cf3bc.tar.gz |
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
Diffstat (limited to 'lib/libprocstat')
-rw-r--r-- | lib/libprocstat/libprocstat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index e1ec7af..d8d39bb 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2052,7 +2052,7 @@ procstat_getumask_sysctl(pid_t pid, unsigned short *maskp) 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); } |