Date: Thu, 20 Sep 2001 10:28:56 -0400 From: Leo Bicknell <bicknell@ufp.org> 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 Message-ID: <20010920102856.B51134@ussenterprise.ufp.org> In-Reply-To: <E15k1tE-0000r2-00@vbook.express.ru>; from vova@express.ru on Thu, Sep 20, 2001 at 03:21:08PM %2B0400 References: <E15k1tE-0000r2-00@vbook.express.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010920102856.B51134>