[geocode-glib/bilelmoussaoui/deprecated-api: 4/4] stop using g_get_current_time




commit 772b7f2e6d151ad0253c9c87bb272fd7519cf457
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Fri Jan 14 15:07:56 2022 +0100

    stop using g_get_current_time
    
    It is not 2038 safe, replace it better equivalent g_get_real_time

 geocode-glib/geocode-location.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/geocode-glib/geocode-location.c b/geocode-glib/geocode-location.c
index 5be1711..3ff93ff 100644
--- a/geocode-glib/geocode-location.c
+++ b/geocode-glib/geocode-location.c
@@ -228,15 +228,15 @@ geocode_location_constructed (GObject *object)
 {
         GeocodeLocation *location = GEOCODE_LOCATION (object);
         GeocodeLocationPrivate *priv;
-        GTimeVal tv;
+        guint64 secs;
 
         priv = geocode_location_get_instance_private (location);
 
         if (priv->timestamp != 0)
                 return;
 
-        g_get_current_time (&tv);
-        geocode_location_set_timestamp (location, tv.tv_sec);
+        secs = g_get_real_time () / G_USEC_PER_SEC;
+        geocode_location_set_timestamp (location, secs);
 }
 
 static void


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