Assorted warning fixes and added a comment, no code changes
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 16 Jan 2017 16:31:05 +0000 (17:31 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 16 Jan 2017 16:31:05 +0000 (17:31 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/wget.c
procps/ps.c
procps/pstree.c

index d5a92a9507564f29fe92ca964d2081769cde0d84..5da6481c18f41baa433c20ee1e74ce92745e0e3b 100644 (file)
@@ -1092,6 +1092,9 @@ static void download_one_url(const char *url)
 
                fflush(sfp);
 
+/* Tried doing this unconditionally.
+ * Cloudflare and nginx/1.11.5 are shocked to see SHUT_WR on non-HTTPS.
+ */
 #if SSL_SUPPORTED
                if (target.protocol == P_HTTPS) {
                        /* If we use SSL helper, keeping our end of the socket open for writing
index 1d380590d409a469d6946a7826554da52588854e..e8b122c5afa6cd4ced5a409ab2e37da3a8dbe2ac 100644 (file)
@@ -608,7 +608,9 @@ int ps_main(int argc UNUSED_PARAM, char **argv)
        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 @@ int ps_main(int argc UNUSED_PARAM, char **argv)
         * 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));
index c5fb83688ed4f95e394a7680ae3358ec617b06e4..f97e99639f3303b46a944c189224faa823a51330 100644 (file)
@@ -357,7 +357,9 @@ static void handle_thread(const char *comm, pid_t pid, pid_t ppid, uid_t uid)
 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 @@ static void mread_proc(void)
 #endif
                {
                        add_proc(p->comm, p->pid, p->ppid, p->uid/*, 0*/);
+#if ENABLE_FEATURE_SHOW_THREADS
                        parent = p->pid;
+#endif
                }
        }
 }