Date: Sat, 9 Jan 2016 17:35:09 +0000 (UTC) From: Dmitry Chagin <dchagin@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: r293580 - stable/10/sys/compat/linprocfs Message-ID: <201601091735.u09HZ9px061656@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sat Jan 9 17:35:09 2016 New Revision: 293580 URL: https://svnweb.freebsd.org/changeset/base/293580 Log: MFC r283478: Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks and initialize pn_vis by well known procfs_candebug(). Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:33:13 2016 (r293579) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:35:09 2016 (r293580) @@ -931,32 +931,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) static int linprocfs_doprocenviron(PFS_FILL_ARGS) { - int ret; - - PROC_LOCK(p); - if ((ret = p_candebug(td, p)) != 0) { - PROC_UNLOCK(p); - return (ret); - } /* * Mimic linux behavior and pass only processes with usermode * address space as valid. Return zero silently otherwize. */ - if (p->p_vmspace == &vmspace0) { - PROC_UNLOCK(p); - return (0); - } - - if ((p->p_flag & P_SYSTEM) != 0) { - PROC_UNLOCK(p); + if (p->p_vmspace == &vmspace0) return (0); - } - PROC_UNLOCK(p); - - ret = proc_getenvv(td, p, sb); - return (ret); + return (proc_getenvv(td, p, sb)); } static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n"; @@ -1468,7 +1451,7 @@ linprocfs_init(PFS_INIT_ARGS) pfs_create_link(dir, "cwd", &linprocfs_doproccwd, NULL, NULL, NULL, 0); pfs_create_file(dir, "environ", &linprocfs_doprocenviron, - NULL, NULL, NULL, PFS_RD); + NULL, &procfs_candebug, NULL, PFS_RD); pfs_create_link(dir, "exe", &procfs_doprocfile, NULL, &procfs_notsystem, NULL, 0); pfs_create_file(dir, "maps", &linprocfs_doprocmaps,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091735.u09HZ9px061656>