diff options
author | cjc <cjc@FreeBSD.org> | 2001-09-22 09:33:00 +0000 |
---|---|---|
committer | cjc <cjc@FreeBSD.org> | 2001-09-22 09:33:00 +0000 |
commit | b78a2af2f6f5c077ba100abb60e3e4bf0980f5e4 (patch) | |
tree | 22f5756e301c514139d7123fb5c86cb198e55a1a | |
parent | 2edf22b4470f9876c6af4bafa39f261d9e107ffd (diff) | |
download | FreeBSD-src-b78a2af2f6f5c077ba100abb60e3e4bf0980f5e4.zip FreeBSD-src-b78a2af2f6f5c077ba100abb60e3e4bf0980f5e4.tar.gz |
Fixing a bug that causes very short uptimes (less than one minute) to
be 30 seconds off. (Thanks to Vladimir B.Grebenschikov
<vova@express.ru> for the PR and ru for a more elegant fix.)
PR: bin/30680
Approved by: ru
-rw-r--r-- | usr.bin/w/w.c | 3 |
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; |