src/pstree.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pstree.c b/src/pstree.c index db57244..6e14169 100644 --- a/src/pstree.c +++ b/src/pstree.c @@ -140,7 +140,11 @@ static char last_char = 0; static int dumped = 0; /* used by dump_by_user */ static int charlen = 0; /* length of character */ +#ifdef WITH_SELINUX +static void fix_orphans(security_context_t scontext); +#else static void fix_orphans(void); +#endif /* * Allocates additional buffer space for width and more as needed. * The first call will allocate the first buffer. @@ -787,7 +791,11 @@ static void read_proc(void) } } (void) closedir(dir); +#ifdef WITH_SELINUX + fix_orphans(scontext); +#else fix_orphans(); +#endif if (print_args) free(buffer); if (empty) { @@ -796,7 +804,11 @@ static void read_proc(void) } } +#ifdef WITH_SELINUX +static void fix_orphans(security_context_t scontext) +#else static void fix_orphans(void) +#endif { /* When using kernel 3.3 with hidepid feature enabled on /proc * then we need fake root pid and gather all the orphan processes