Subject: bin/5699: rusers(1) gets idle time wrong
To: None <gnats-bugs@gnats.netbsd.org>
From: Urban Boquist <boquist@cs.chalmers.se>
List: netbsd-bugs
Date: 07/03/1998 19:41:36
>Number: 5699
>Category: bin
>Synopsis: rusers gets idle time wrong
>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 Jul 3 10:50:00 1998
>Last-Modified:
>Originator: Urban Boquist
>Organization:
Dept. of CS, Chalmers, Sweden
>Release: NetBSD-current June 1998
>Environment:
System: NetBSD dogbert.cs.chalmers.se 1.3E NetBSD 1.3E (DOGBERT) #0: Thu Mar 12 10:45:34 CET 1998 augustss@dogbert.cs.chalmers.se:/usr/src/sys/arch/i386/compile/DOGBERT i386
>Description:
rusers calculates hours from minutes by dividing with 24 instead of 60.
>How-To-Repeat:
Try "rusers -l".
>Fix:
--- rusers.c.orig Fri Jul 3 19:28:47 1998
+++ rusers.c Fri Jul 3 19:33:30 1998
@@ -160,8 +160,8 @@
days = minutes / (24 * 60);
minutes %= (24 * 60);
- hours = minutes / 24;
- minutes %= 24;
+ hours = minutes / 60;
+ minutes %= 60;
if (days > 0)
snprintf(idle, sizeof(idle), "%d d ", days);
>Audit-Trail:
>Unformatted: