]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: use deserialize_timestamp_value() 2611/head
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Mon, 15 Feb 2016 18:04:49 +0000 (00:04 +0600)
committerAlexander Kuleshov <kuleshovmail@gmail.com>
Mon, 15 Feb 2016 18:04:49 +0000 (00:04 +0600)
which is introduced in the ebf30a086d commit.

src/login/logind-session.c
src/login/logind-user.c

index 417b7f5d98a2e977a4dbd2e715e285e697fb27e8..9874cdae5e265c62f3e8ac582da9f3f063486ecb 100644 (file)
@@ -446,17 +446,8 @@ int session_load(Session *s) {
                 safe_close(fd);
         }
 
-        if (realtime) {
-                unsigned long long l;
-                if (sscanf(realtime, "%llu", &l) > 0)
-                        s->timestamp.realtime = l;
-        }
-
-        if (monotonic) {
-                unsigned long long l;
-                if (sscanf(monotonic, "%llu", &l) > 0)
-                        s->timestamp.monotonic = l;
-        }
+        deserialize_timestamp_value(realtime, &s->timestamp.realtime);
+        deserialize_timestamp_value(monotonic, &s->timestamp.monotonic);
 
         if (controller) {
                 if (bus_name_has_owner(s->manager->bus, controller, NULL) > 0)
index 6b9c69cc45d356fff928546c62abc5450ac69aee..aa27f73a874973109f146bf83eaca72f87b16aab 100644 (file)
@@ -321,17 +321,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;
 }