Fix erroneous times() call in udpstat/tcpstat.

Reported by John Peace, bug #312.
Also fix times(2) man page.
This commit is contained in:
David van Moolenbroek
2009-10-01 10:31:29 +00:00
parent 6539c356c6
commit a8ebc69c6e
3 changed files with 11 additions and 4 deletions
+2 -1
View File
@@ -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<TCP_CONN_NR; i++)
+2 -1
View File
@@ -56,6 +56,7 @@ int main(int argc, char*argv[])
clock_t now;
int fl;
int a_flag, n_flag;
struct tms tmsbuf;
(prog_name=strrchr(argv[0], '/')) ? prog_name++ : (prog_name=argv[0]);
@@ -221,7 +222,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<UDP_FD_NR; i++)