From msinz@wgate.com  Thu Sep 20 04:44:28 2001
Return-Path: <msinz@wgate.com>
Received: from mx.wgate.com (mail.wgate.com [38.219.83.4])
	by hub.freebsd.org (Postfix) with SMTP id 6732437B409
	for <FreeBSD-gnats-submit@FreeBSD.ORG>; Thu, 20 Sep 2001 04:44:27 -0700 (PDT)
Received: From MAIL.TVOL.NET (10.1.1.4[10.1.1.4 port:3933]) by mx.wgate.comMail essentials (server 2.429) with SMTP id: <6978@mx.wgate.com>transfer for <FreeBSD-gnats-submit@FreeBSD.ORG>; Thu, 20 Sep 2001 7:43:09 AM -0400 ;transfer smtpmailfrom <msinz@wgReceived: from sinz.eng.tvol.net ([10.32.2.99]) by mail.tvol.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)id THV3CRM7; Thu, 20 Sep 2001 07:43:00 -0400
Received: from wgate.com (localhost [127.0.0.1])by sinz.eng.tvol.net (8.11.6/8.11.6) with ESMTP id f8KBi6s93355;Thu, 20 Sep 2001 07:44:06 -0400 (EDT)(envelope-from msinz@wgate.com)
Message-Id: <402391c804246507d1@[192.168.1.4]>
Date: Thu, 20 Sep 2001 07:44:06 -0400
From: Michael Sinz <msinz@wgate.com>
Sender: msinz@wgate.com
To: "Vladimir B.Grebenschikov" <vova@express.ru>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject: Re: uptime and w utilities lie about real uptime
References: <400de87e0423b007d1@[192.168.1.4]>

>Number:         30681
>Category:       bin
>Synopsis:       Re: uptime and w utilities lie about real uptime
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 20 04:50:01 PDT 2001
>Closed-Date:    Sat Sep 22 09:24:05 PDT 2001
>Last-Modified:  Wed Oct 26 05:16:35 GMT 2005
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 "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.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: greid 
State-Changed-When: Sat Sep 22 09:24:05 PDT 2001 
State-Changed-Why:  
Part of a different Audit-Trail 


Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: greid 
Responsible-Changed-When: Sat Sep 22 09:24:05 PDT 2001 
Responsible-Changed-Why:  
Misfiled 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30681 
>Unformatted:
