summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/w/w.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 2bc15fe..d00713d 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -452,7 +452,8 @@ pr_header(nowp, nusers)
if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 &&
boottime.tv_sec != 0) {
uptime = now - boottime.tv_sec;
- uptime += 30;
+ if (uptime > 60)
+ uptime += 30;
days = uptime / 86400;
uptime %= 86400;
hrs = uptime / 3600;
OpenPOWER on IntegriCloud