Assorted warning fixes and added a comment, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/procps/ps.c b/procps/ps.c
index 1d38059..e8b122c 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -608,7 +608,9 @@
procps_status_t *p;
llist_t* opt_o = NULL;
char default_o[sizeof(DEFAULT_O_STR)];
+#if ENABLE_SELINUX || ENABLE_FEATURE_SHOW_THREADS
int opt;
+#endif
enum {
OPT_Z = (1 << 0),
OPT_o = (1 << 1),
@@ -638,7 +640,11 @@
* procps v3.2.7 supports -T and shows tids as SPID column,
* it also supports -L where it shows tids as LWP column.
*/
- opt = getopt32(argv, "Zo:*aAdefl"IF_FEATURE_SHOW_THREADS("T"), &opt_o);
+#if ENABLE_SELINUX || ENABLE_FEATURE_SHOW_THREADS
+ opt =
+#endif
+ getopt32(argv, "Zo:*aAdefl"IF_FEATURE_SHOW_THREADS("T"), &opt_o);
+
if (opt_o) {
do {
parse_o(llist_pop(&opt_o));
diff --git a/procps/pstree.c b/procps/pstree.c
index c5fb836..f97e996 100644
--- a/procps/pstree.c
+++ b/procps/pstree.c
@@ -357,7 +357,9 @@
static void mread_proc(void)
{
procps_status_t *p = NULL;
+#if ENABLE_FEATURE_SHOW_THREADS
pid_t parent = 0;
+#endif
int flags = PSSCAN_COMM | PSSCAN_PID | PSSCAN_PPID | PSSCAN_UIDGID | PSSCAN_TASKS;
while ((p = procps_scan(p, flags)) != NULL) {
@@ -368,7 +370,9 @@
#endif
{
add_proc(p->comm, p->pid, p->ppid, p->uid/*, 0*/);
+#if ENABLE_FEATURE_SHOW_THREADS
parent = p->pid;
+#endif
}
}
}