ps: fix build failure if FEATURE_PS_TIME is disabled
authorRon Yorston <rmy@pobox.com>
Tue, 22 Aug 2017 10:21:56 +0000 (11:21 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 22 Aug 2017 13:39:13 +0000 (15:39 +0200)
The global seconds_since_boot is only defined if FEATURE_PS_TIME
is enabled.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
procps/ps.c

index fe2d8c294ec2ab8adc6d48299e429b91878eb8b9..54e6c40fc5cc79a4a799fbe53b9ae60c132af3f5 100644 (file)
@@ -567,9 +567,11 @@ int ps_main(int argc UNUSED_PARAM, char **argv)
        };
 
        INIT_G();
+#if ENABLE_FEATURE_PS_TIME
        G.seconds_since_boot = get_uptime();
-#if ENABLE_FEATURE_PS_TIME && (ENABLE_FEATURE_PS_UNUSUAL_SYSTEMS || !defined(__linux__))
+# if ENABLE_FEATURE_PS_UNUSUAL_SYSTEMS || !defined(__linux__)
        G.kernel_HZ = bb_clk_tck(); /* this is sysconf(_SC_CLK_TCK) */
+# endif
 #endif
 
        // POSIX: