Subject: bin/3688: uptime is confused by 0s < uptime < 60s.
To: None <gnats-bugs@gnats.netbsd.org>
From: Ignatios Souvatzis <ignatios@cosinus.cs.uni-bonn.de>
List: netbsd-bugs
Date: 05/30/1997 19:12:34
>Number:         3688
>Category:       bin
>Synopsis:       uptime is confused when uptime is less than one minute.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 30 10:20:00 1997
>Last-Modified:
>Originator:     Ignatios Souvatzis
>Organization:
computer science department, university of Bonn, Germany
>Release:        Reported for 1.2.1 and 1.2E
>Environment:
	
System: NetBSD cosinus.cs.uni-bonn.de 1.2E NetBSD 1.2E (COSINUS) #59: Tue May 20 20:01:58 MEST 1997 ignatios@cosinus.cs.uni-bonn.de:/usr/obj.i386/kernel/COSINUS i386


>Description:
If the uptime is less then one minute, but more than 0 seconds,
"uptime" prints (e.g.):

 6:42PM  up 1 user, load averages: 0.17, 0.14, 0.09

Originally reported by Jon Ribbens <jon@oaktree.co.uk>.

>How-To-Repeat:
Reboot cleanly into single user mode, mount / and /usr,
issue "uptime".
>Fix:
Replace the check 
	    boottime.tv_sec != 0) {
by
	    boottime.tv_sec > 59) {

in src/usr.bin/w/w.c, line 387... this will make it print
 6:42PM  1 user, load averages: 0.17, 0.14, 0.09
like for uptiimes less than one seconds.

Maybe we should make it print the number of seconds in this case?
>Audit-Trail:
>Unformatted: