chiark / gitweb /
logind: use deserialize_timestamp_value()
[elogind.git] / src / login / logind-user.c
index b6daf65296920c8285e903ddd2506002f988c828..1814a0e8f52290036739868c19b80365e1ee6a14 100644 (file)
@@ -326,17 +326,8 @@ int user_load(User *u) {
         if (s && s->display && display_is_local(s->display))
                 u->display = s;
 
-        if (realtime) {
-                unsigned long long l;
-                if (sscanf(realtime, "%llu", &l) > 0)
-                        u->timestamp.realtime = l;
-        }
-
-        if (monotonic) {
-                unsigned long long l;
-                if (sscanf(monotonic, "%llu", &l) > 0)
-                        u->timestamp.monotonic = l;
-        }
+        deserialize_timestamp_value(realtime, &u->timestamp.realtime);
+        deserialize_timestamp_value(monotonic, &u->timestamp.monotonic);
 
         return r;
 }