Added test for end of string. (get_scaled): Cleaned.

* glibtop_server.h (skip_line): Added test for end of string.
        (get_scaled): Cleaned.

        * cpu.c (glibtop_get_cpu_s):
        * open.c (glibtop_open_s): Fixed SMP detection. Closes #142597.
        * uptime.c (glibtop_get_uptime_s): Added boot_time.
This commit is contained in:
Benoît Dejean
2004-05-25 14:33:46 +00:00
parent f070fea744
commit 0de7c96d2a
5 changed files with 46 additions and 40 deletions

View File

@@ -24,6 +24,7 @@
#include <config.h>
#include <glibtop/error.h>
#include <glibtop/uptime.h>
#include <time.h>
static unsigned long _glibtop_sysdeps_uptime =
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
@@ -64,6 +65,7 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
buf->uptime = strtod (buffer, &p);
buf->idletime = strtod (p, &p);
buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
buf->flags = _glibtop_sysdeps_uptime;
}