[glib: 16/26] gdbusutils: Stop using g_get_current_time()



commit def5db23a31d7b9ca4a6e86a3ca585c593309e03
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Jul 24 13:55:08 2019 +0100

    gdbusutils: Stop using g_get_current_time()
    
    It is deprecated.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Helps: #1438

 gio/gdbusutils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gio/gdbusutils.c b/gio/gdbusutils.c
index bfca02d6f..ff9b44117 100644
--- a/gio/gdbusutils.c
+++ b/gio/gdbusutils.c
@@ -291,22 +291,22 @@ gchar *
 g_dbus_generate_guid (void)
 {
   GString *s;
-  GTimeVal now;
   guint32 r1;
   guint32 r2;
   guint32 r3;
+  gint64 now_us;
 
   s = g_string_new (NULL);
 
   r1 = g_random_int ();
   r2 = g_random_int ();
   r3 = g_random_int ();
-  g_get_current_time (&now);
+  now_us = g_get_real_time ();
 
   g_string_append_printf (s, "%08x", r1);
   g_string_append_printf (s, "%08x", r2);
   g_string_append_printf (s, "%08x", r3);
-  g_string_append_printf (s, "%08x", (guint32) now.tv_sec);
+  g_string_append_printf (s, "%08x", (guint32) (now_us / G_USEC_PER_SEC));
 
   return g_string_free (s, FALSE);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]