diff options
author | dchagin <dchagin@FreeBSD.org> | 2016-01-09 17:35:09 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2016-01-09 17:35:09 +0000 |
commit | 6b41a1356a77b6c3f166b550391253454c37267c (patch) | |
tree | fd1b6c863baf4497aabf12c0eab9d49eedd58aef /sys/compat | |
parent | 35570fa80b57de598abae862add770e92bd0eb79 (diff) | |
download | FreeBSD-src-6b41a1356a77b6c3f166b550391253454c37267c.zip FreeBSD-src-6b41a1356a77b6c3f166b550391253454c37267c.tar.gz |
MFC r283478:
Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks
and initialize pn_vis by well known procfs_candebug().
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 0494aa9..6e591e9 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -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, |