From 9bd351abaebc4fc8e02851ee2f8ebd8796bfb237 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 29 Jul 1999 18:56:26 +0000 Subject: [PATCH] Fix bug reported by Takis Psarogiannakopoulos: `start_time' are seconds 1999-07-29 Martin Baulig * proctime.c (glibtop_get_proc_time_p): Fix bug reported by Takis Psarogiannakopoulos: `start_time' are seconds since the epoch as it is stated in the manual. --- sysdeps/freebsd/ChangeLog | 6 ++++++ sysdeps/freebsd/proctime.c | 2 +- sysdeps/solaris/ChangeLog | 6 ++++++ sysdeps/solaris/proctime.c | 3 +-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/sysdeps/freebsd/ChangeLog b/sysdeps/freebsd/ChangeLog index 8e2d1f88..c7fdef82 100644 --- a/sysdeps/freebsd/ChangeLog +++ b/sysdeps/freebsd/ChangeLog @@ -1,3 +1,9 @@ +1999-07-29 Martin Baulig + + * proctime.c (glibtop_get_proc_time_p): Fix bug reported by + Takis Psarogiannakopoulos: `start_time' are seconds since the + epoch as it is stated in the manual. + Tue Jun 15 16:04:10 1999 Timur Bakeyev * procuid.c: A fix to a ommitted case, when nor NetBSD, nor diff --git a/sysdeps/freebsd/proctime.c b/sysdeps/freebsd/proctime.c index 5af034e3..d7fbecfe 100644 --- a/sysdeps/freebsd/proctime.c +++ b/sysdeps/freebsd/proctime.c @@ -188,7 +188,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, buf->cutime = tv2sec (pstats.p_cru.ru_utime); buf->cstime = tv2sec (pstats.p_cru.ru_stime); - buf->start_time = tv2sec (pstats.p_start); + buf->start_time = (u_int64_t) pstats.p_start.tv_sec; buf->flags |= _glibtop_sysdeps_proc_time_user; #else diff --git a/sysdeps/solaris/ChangeLog b/sysdeps/solaris/ChangeLog index 10c84450..6f25ae49 100644 --- a/sysdeps/solaris/ChangeLog +++ b/sysdeps/solaris/ChangeLog @@ -1,3 +1,9 @@ +1999-07-29 Martin Baulig + + * proctime.c (glibtop_get_proc_time_p): Fix bug reported by + Takis Psarogiannakopoulos: `start_time' are seconds since the + epoch as it is stated in the manual. + 1999-07-16 Drazen Kacar * proclist.c: Bug fix. All Solaris versions have RUID and diff --git a/sysdeps/solaris/proctime.c b/sysdeps/solaris/proctime.c index 1c63bd0c..6fef5169 100644 --- a/sysdeps/solaris/proctime.c +++ b/sysdeps/solaris/proctime.c @@ -55,8 +55,7 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, if (glibtop_get_proc_data_usage_s (server, &prusage, pid)) return; - buf->start_time = prusage.pr_create.tv_sec * 1E+6 + - prusage.pr_create.tv_nsec / 1E+3; + buf->start_time = prusage.pr_create.tv_sec; buf->rtime = prusage.pr_rtime.tv_sec * 1E+6 + prusage.pr_rtime.tv_nsec / 1E+3;