summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-04-13 18:26:39 +0000
committerJim Meyering <jim@meyering.net>1996-04-13 18:26:39 +0000
commitbe333ac3a5a28626752045efb82c03c289156fd0 (patch)
tree89487fc7bf196c18428470ec7a61b08f68191674
parent62b978f77c5371c395a2540ca68e78df520e527e (diff)
downloadcoreutils-be333ac3a5a28626752045efb82c03c289156fd0.tar.xz
(print_uptime): Invoke getloadavg only if we have it.
-rw-r--r--src/who-users.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/who-users.c b/src/who-users.c
index 74fb286d4..b9172d042 100644
--- a/src/who-users.c
+++ b/src/who-users.c
@@ -191,7 +191,12 @@ print_uptime (int n)
printf (" %2d:%02d, %d %s", uphours, upmins, entries,
(entries == 1) ? _("user") : _("users"));
+#ifdef HAVE_GETLOADAVG
loads = getloadavg (avg, 3);
+#else
+ loads = -1;
+#endif
+
if (loads == -1)
putchar ('\n');
else