# HG changeset patch # User Mikael Berthe # Date 1289511101 -3600 # Node ID 55944382d88b80b98ad07d4079f244d6b960b633 # Parent d8550798bb1deb724c71899f1076a5285314c584 Use sysconf(_SC_CLK_TCK) and G_GSIZE_MODIFIER diff -r d8550798bb1d -r 55944382d88b uptime.c --- a/uptime.c Thu Nov 11 22:21:13 2010 +0100 +++ b/uptime.c Thu Nov 11 22:31:41 2010 +0100 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -152,7 +153,10 @@ while (*u && isdigit (*u)) u++; *u = '\0'; if (!sscanf (p, "%llu", &mstime)) { - scr_log_print (LPRINT_LOGNORM, "uptime: now at %u/%u, remaining string: %s.", p - line -> str, line -> len, p); + scr_log_print (LPRINT_LOGNORM, "uptime: now at " + "%" G_GSIZE_MODIFIER "u/%" G_GSIZE_MODIFIER "u, " + "remaining string: %s.", + p - line -> str, line -> len, p); g_string_free (line, TRUE); return "Malformed own start time."; } @@ -184,7 +188,7 @@ guint hz = settings_opt_get_int ("uptime_hz"); if (!hz) - hz = 100; + hz = sysconf(_SC_CLK_TCK); starttime = kbtime + (mstime / hz); } else starttime = time (NULL);