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

src/machine/machine.c

index 406d5a4b854dc6273b8904db16fb5d4b3298e45c..7e92ffc47485799b1b9a8be53edc168937351454 100644 (file)
@@ -299,17 +299,8 @@ int machine_load(Machine *m) {
                         m->class = c;
         }
 
-        if (realtime) {
-                unsigned long long l;
-                if (sscanf(realtime, "%llu", &l) > 0)
-                        m->timestamp.realtime = l;
-        }
-
-        if (monotonic) {
-                unsigned long long l;
-                if (sscanf(monotonic, "%llu", &l) > 0)
-                        m->timestamp.monotonic = l;
-        }
+        deserialize_timestamp_value(realtime, &m->timestamp.realtime);
+        deserialize_timestamp_value(monotonic, &m->timestamp.monotonic);
 
         if (netif) {
                 size_t allocated = 0, nr = 0;