From owner-svn-src-all@FreeBSD.ORG Tue Aug 30 11:50:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6301C106567C; Tue, 30 Aug 2011 11:50:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533898FC0C; Tue, 30 Aug 2011 11:50:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UBoSLY050159; Tue, 30 Aug 2011 11:50:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UBoSur050157; Tue, 30 Aug 2011 11:50:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108301150.p7UBoSur050157@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 30 Aug 2011 11:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225261 - stable/8/sys/fs/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 11:50:28 -0000 Author: kib Date: Tue Aug 30 11:50:28 2011 New Revision: 225261 URL: http://svn.freebsd.org/changeset/base/225261 Log: MFC r224915: Do not return success and a string "unknown" when vn_fullpath() was unable to resolve the path of the text vnode of the process. The behaviour is very confusing for any consumer of the procfs, in particular, java. Modified: stable/8/sys/fs/procfs/procfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/procfs/procfs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs.c Tue Aug 30 11:49:22 2011 (r225260) +++ stable/8/sys/fs/procfs/procfs.c Tue Aug 30 11:50:28 2011 (r225261) @@ -67,20 +67,23 @@ int procfs_doprocfile(PFS_FILL_ARGS) { - char *fullpath = "unknown"; - char *freepath = NULL; + char *fullpath; + char *freepath; struct vnode *textvp; + int error; + freepath = NULL; PROC_LOCK(p); textvp = p->p_textvp; vhold(textvp); PROC_UNLOCK(p); - vn_fullpath(td, textvp, &fullpath, &freepath); + error = vn_fullpath(td, textvp, &fullpath, &freepath); vdrop(textvp); - sbuf_printf(sb, "%s", fullpath); - if (freepath) + if (error == 0) + sbuf_printf(sb, "%s", fullpath); + if (freepath != NULL) free(freepath, M_TEMP); - return (0); + return (error); } /*