From a8ebc69c6ec1eed2be222cba774a1de01f236ad9 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Thu, 1 Oct 2009 10:31:29 +0000 Subject: [PATCH] Fix erroneous times() call in udpstat/tcpstat. Reported by John Peace, bug #312. Also fix times(2) man page. --- commands/simple/tcpstat.c | 3 ++- commands/simple/udpstat.c | 3 ++- man/man2/times.2 | 9 +++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/commands/simple/tcpstat.c b/commands/simple/tcpstat.c index 6fa78da65..2d2a8f235 100644 --- a/commands/simple/tcpstat.c +++ b/commands/simple/tcpstat.c @@ -52,6 +52,7 @@ int main(int argc, char*argv[]) clock_t now; int fl; int a_flag, n_flag, v_flag; + struct tms tmsbuf; getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz); @@ -130,7 +131,7 @@ int main(int argc, char*argv[]) } now= uptime.tv_sec * HZ + (uptime.tv_usec*HZ/1000000); #else /* Minix 3 */ - now= times(NULL); + now= times(&tmsbuf); #endif for (i= 0; i