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




commit fa6febce6f8b3493ad078c4dda8f0c73813ef53d
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 a60bfe9..4bf4bed 100644
--- a/geocode-glib/geocode-location.c
+++ b/geocode-glib/geocode-location.c
@@ -207,13 +207,13 @@ static void
 geocode_location_constructed (GObject *object)
 {
         GeocodeLocation *location = GEOCODE_LOCATION (object);
-        GTimeVal tv;
+        guint64 secs;
 
         if (location->priv->timestamp != 0)
                 return;
 
-        g_get_current_time (&tv);
-        geocode_location_set_timestamp (location, tv.tv_sec);
+        secs = g_get_real_time ();
+        geocode_location_set_timestamp (location, secs);
 }
 
 static void


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