Bug 30681

Summary: Re: uptime and w utilities lie about real uptime
Product: Base System Reporter: Michael Sinz <msinz>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: FreeBSD-gnats-submit
Priority: Normal    
Version: 1.0-RELEASE   
Hardware: Any   
OS: Any   

Description Michael Sinz 2001-09-20 12:50:01 UTC
 "Vladimir B.Grebenschikov" wrote:
 > 
 > >Submitter-Id:  current-users
 > >Originator:    Vladimir B. Grebenschikov
 > >Organization:  TSB "Russian Express"
 > >Confidential:  no
 > >Synopsis:      uptime and w utilities lie about real uptime
 > >Severity:      non-critical
 > >Priority:      low
 > >Category:      bin
 > >Class:         sw-bug
 > >Release:       FreeBSD 5.0-CURRENT i386
 > >Environment:
 > System: FreeBSD vbook.express.ru 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Sep 19 20:26:25 MSD 2001 root@vbook.express.ru:/usr/src.local/sys/i386/compile/VBOOK i386
 > 
 > >Description:
 > 
 >         Just after very fast boot uptimealways shows more than 30 sec.
 > 
 >         looking to src/usr/bin/w/w.c:
 > 
 >         if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 &&
 >             boottime.tv_sec != 0) {
 >                 uptime = now - boottime.tv_sec;
 >                 uptime += 30;
 > ====================== ^^^^^
 >                 days = uptime / 86400;
 >                 uptime %= 86400;
 >                 hrs = uptime / 3600;
 >                 uptime %= 3600;
 >                 mins = uptime / 60;
 >                 secs = uptime % 60;
 >                 (void)printf(" up");
 > 
 > why utility increases uptime on 30 seconds ??
 > Is any real reasons for it ?
 
 From my reading of this, it seems to want to round the uptime to
 the nearest minute -- afterall, w and uptime both only show the uptime
 in minutes (well, days, hours, and minutes)
 
 -- 
 Michael Sinz ---- Worldgate Communications ---- msinz@wgate.com
 A master's secrets are only as good as
 	the master's ability to explain them to others.
Comment 1 greid freebsd_committer freebsd_triage 2001-09-22 17:24:05 UTC
State Changed
From-To: open->closed

Part of a different Audit-Trail 


Comment 2 greid freebsd_committer freebsd_triage 2001-09-22 17:24:05 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs

Misfiled