--- psmisc-22.20/src/pstree.c 2012-09-19 14:05:43.000000000 +0100
+++ psmisc-22.20-selinux/src/pstree.c 2012-10-08 19:18:13.992951873 +0100
@@ -140,7 +140,12 @@
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 +792,11 @@
}
}
(void) closedir(dir);
+#ifdef WITH_SELINUX
+ fix_orphans(scontext);
+#else
fix_orphans();
+#endif
if (print_args)
free(buffer);
if (empty) {
@@ -796,7 +805,11 @@
}
}
+#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