From owner-freebsd-hackers Thu Sep 20 7:29: 4 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by hub.freebsd.org (Postfix) with ESMTP id E388837B419; Thu, 20 Sep 2001 07:29:00 -0700 (PDT) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.11.1/8.11.1) id f8KESur51565; Thu, 20 Sep 2001 10:28:56 -0400 (EDT) (envelope-from bicknell) Date: Thu, 20 Sep 2001 10:28:56 -0400 From: Leo Bicknell To: "Vladimir B.Grebenschikov" Cc: FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: uptime and w utilities lie about real uptime Message-ID: <20010920102856.B51134@ussenterprise.ufp.org> Mail-Followup-To: Leo Bicknell , "Vladimir B.Grebenschikov" , FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from vova@express.ru on Thu, Sep 20, 2001 at 03:21:08PM +0400 Organization: United Federation of Planets Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It's rounding to minutes when it shouldn't, uptime only displays seconds for very short uptimes, and then always rounds to minutes. Your patch causes it to truncate, which is probably the right thing to do, the alternative would be: if (uptime > 60) uptime += 30; That way it won't start rounding until a full minute has passed, allowing the first 60 seconds to be displayed properly. This has less of a chance of breaking things depending on the rounding, but I would hope ther are none of those. -- Leo Bicknell - bicknell@ufp.org Systems Engineer - Internetworking Engineer - CCIE 3440 Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message