From owner-svn-src-projects@FreeBSD.ORG Wed Jun 24 19:05:39 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7F45106566C; Wed, 24 Jun 2009 19:05:39 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B672F8FC1D; Wed, 24 Jun 2009 19:05:39 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5OJ5dlR025493; Wed, 24 Jun 2009 19:05:39 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5OJ5d2t025490; Wed, 24 Jun 2009 19:05:39 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906241905.n5OJ5d2t025490@svn.freebsd.org> From: Ulf Lilleengen Date: Wed, 24 Jun 2009 19:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194887 - in projects/libprocstat/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 19:05:40 -0000 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