summary refs log tree commit diff stats
path: root/qga/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'qga/main.c')
-rw-r--r--qga/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/qga/main.c b/qga/main.c
index b9dd19918e..1deb0ee2fb 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -314,7 +314,6 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
                    const gchar *msg, gpointer opaque)
 {
     GAState *s = opaque;
-    GTimeVal time;
     const char *level_str = ga_log_level_str(level);
 
     if (!ga_logging_enabled(s)) {
@@ -329,9 +328,11 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
 #else
     if (level & s->log_level) {
 #endif
-        g_get_current_time(&time);
+        gint64 t = g_get_real_time();
         fprintf(s->log_file,
-                "%lu.%lu: %s: %s\n", time.tv_sec, time.tv_usec, level_str, msg);
+                "%" G_GINT64_FORMAT ".%" G_GINT64_FORMAT
+                ": %s: %s\n", t / G_USEC_PER_SEC, t % G_USEC_PER_SEC,
+                level_str, msg);
         fflush(s->log_file);
     }
 }