diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c index 869946d976197a534fecafa00bf58e56497c4f7d..0f9e45c4d03e5eade93f6079f5813695dc75dfc3 100644 --- a/gio/gdbusauthmechanismsha1.c +++ b/gio/gdbusauthmechanismsha1.c @@ -603,7 +603,7 @@ keyring_generate_entry (const gchar *cookie_context, gchar **lines; gint max_line_id; GString *new_contents; - guint64 now; + gint64 now; gboolean have_id; gint use_id; gchar *use_cookie; @@ -658,7 +658,7 @@ keyring_generate_entry (const gchar *cookie_context, } new_contents = g_string_new (NULL); - now = (guint64) time (NULL); + now = g_get_real_time (); changed_file = FALSE; max_line_id = 0; @@ -672,7 +672,7 @@ keyring_generate_entry (const gchar *cookie_context, gchar **tokens; gchar *endp; gint line_id; - guint64 line_when; + gint64 line_when; gboolean keep_entry; if (line[0] == '\0') @@ -745,7 +745,7 @@ keyring_generate_entry (const gchar *cookie_context, if (line_when - now > 24*60*60) { keep_entry = FALSE; - _log ("Deleted SHA1 cookie from %" G_GUINT64_FORMAT " seconds in the future", line_when - now); + _log ("Deleted SHA1 cookie from %" G_GINT64_FORMAT " seconds in the future", line_when - now); } } else @@ -764,7 +764,7 @@ keyring_generate_entry (const gchar *cookie_context, else { g_string_append_printf (new_contents, - "%d %" G_GUINT64_FORMAT " %s\n", + "%d %" G_GINT64_FORMAT " %s\n", line_id, line_when, tokens[2]); @@ -807,9 +807,9 @@ keyring_generate_entry (const gchar *cookie_context, g_free (raw_cookie); g_string_append_printf (new_contents, - "%d %" G_GUINT64_FORMAT " %s\n", + "%d %" G_GINT64_FORMAT " %s\n", *out_id, - (guint64) time (NULL), + g_get_real_time (), *out_cookie); changed_file = TRUE; } diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 1c8fa42e8b24b1556fe43eebbd577888195d3e8d..cf0b8feb5eec994f97d39d5ac018472b73f9ca58 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -2138,7 +2138,7 @@ g_local_file_trash (GFile *file, { time_t t; struct tm now; - t = time (NULL); + t = g_get_real_time (); localtime_r (&t, &now); delete_time[0] = 0; strftime(delete_time, sizeof (delete_time), "%Y-%m-%dT%H:%M:%S", &now); diff --git a/gio/tests/gdbus-example-peer.c b/gio/tests/gdbus-example-peer.c index b954f7426d9ffe08512f3b98614454ce1a71e0bb..767967ecb8662e833a5beae6e4d40f4389bab503 100644 --- a/gio/tests/gdbus-example-peer.c +++ b/gio/tests/gdbus-example-peer.c @@ -273,7 +273,8 @@ main (int argc, char *argv[]) "Negotiated capabilities: unix-fd-passing=%d\n", g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING); - greeting = g_strdup_printf ("Hey, it's %" G_GUINT64_FORMAT " already!", (guint64) time (NULL)); + greeting = g_strdup_printf ("Hey, it's %" G_GINT64_FORMAT " already!", + g_get_real_time ()); value = g_dbus_connection_call_sync (connection, NULL, /* bus_name */ "/org/gtk/GDBus/TestObject", diff --git a/gio/tests/gdbus-example-unix-fd-client.c b/gio/tests/gdbus-example-unix-fd-client.c index cf1330fda4197cb5b4e747bedccefd3346dc9c8b..48a187d65ee3dc2d7d690cc1ddad78298f3a4002 100644 --- a/gio/tests/gdbus-example-unix-fd-client.c +++ b/gio/tests/gdbus-example-unix-fd-client.c @@ -79,7 +79,7 @@ on_name_appeared (GDBusConnection *connection, gssize len; gchar *str; - now = time (NULL); + now = g_get_real_time (); strftime (now_buf, sizeof now_buf, "%Y-%m-%d %H:%M:%S",