--- 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 <time.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include <mcabber/modules.h>
#include <mcabber/logprint.h>
@@ -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);