Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Mar 2014 13:23:50 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r262947 - stable/10/lib/libprocstat
Message-ID:  <201403091323.s29DNosk058858@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Sun Mar  9 13:23:49 2014
New Revision: 262947
URL: http://svnweb.freebsd.org/changeset/base/262947

Log:
  Merge r262690 from head to stable/10:
  
    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.
  
    Sponsored by: DARPA, AFRL

Modified:
  stable/10/lib/libprocstat/libprocstat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libprocstat/libprocstat.c
==============================================================================
--- stable/10/lib/libprocstat/libprocstat.c	Sun Mar  9 13:19:37 2014	(r262946)
+++ stable/10/lib/libprocstat/libprocstat.c	Sun Mar  9 13:23:49 2014	(r262947)
@@ -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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403091323.s29DNosk058858>