Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jun 2009 19:05:39 +0000 (UTC)
From:      Ulf Lilleengen <lulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r194887 - in projects/libprocstat/sys: kern sys
Message-ID:  <200906241905.n5OJ5d2t025490@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lulf
Date: Wed Jun 24 19:05:39 2009
New Revision: 194887
URL: http://svn.freebsd.org/changeset/base/194887

Log:
  - Invert the flag to indicate if VOP_GETATTR was successful rather than
    unsuccessful, as an old kernel will have the padding zero'ed. Doing it this
    way makes it possible for userland tools checking the flag to work correctly
    on older kernels.
  
  Suggested by:	jhb

Modified:
  projects/libprocstat/sys/kern/kern_descrip.c
  projects/libprocstat/sys/sys/user.h

Modified: projects/libprocstat/sys/kern/kern_descrip.c
==============================================================================
--- projects/libprocstat/sys/kern/kern_descrip.c	Wed Jun 24 19:04:08 2009	(r194886)
+++ projects/libprocstat/sys/kern/kern_descrip.c	Wed Jun 24 19:05:39 2009	(r194887)
@@ -2927,10 +2927,9 @@ prepare_kinfo_file(struct vnode *vp, str
 	fullpath = "-";
 	do {
 		error = VOP_GETATTR(vp, &va, NULL);
-		if (error) {
-			kif->kf_status |= KF_GETATTR_FAIL;
+		if (error)
 			break;
-		}
+		kif->kf_status |= KF_ATTR_VALID;
 		kif->kf_file_fsid = va.va_fsid;
 		kif->kf_file_fileid = va.va_fileid;
 		kif->kf_file_mode = MAKEIMODE(va.va_type, va.va_mode);

Modified: projects/libprocstat/sys/sys/user.h
==============================================================================
--- projects/libprocstat/sys/sys/user.h	Wed Jun 24 19:04:08 2009	(r194886)
+++ projects/libprocstat/sys/sys/user.h	Wed Jun 24 19:05:39 2009	(r194887)
@@ -241,7 +241,7 @@ struct user {
  * The KERN_PROC_FILE sysctl allows a process to dump the file descriptor
  * array of another process.
  */
-#define	KF_GETATTR_FAIL	0x0001
+#define	KF_ATTR_VALID	0x0001
 
 #define	KF_TYPE_NONE	0
 #define	KF_TYPE_VNODE	1



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