diff options
author | Alexander Kuleshov <kuleshovmail@gmail.com> | 2016-02-16 00:04:49 +0600 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-06-16 10:12:57 +0200 |
commit | 321944052ce227a1d9b26d268772c7c076d57960 (patch) | |
tree | 1582c0bfac914ba960845cf4512ee8fe1d76d4b4 | |
parent | 3389adca4a8f7dec9885fc8ce034e3302812e436 (diff) |
logind: use deserialize_timestamp_value()
which is introduced in the ebf30a086d commit.
-rw-r--r-- | src/login/logind-session.c | 13 | ||||
-rw-r--r-- | src/login/logind-user.c | 13 |
2 files changed, 4 insertions, 22 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c index c37e87565..accf83d5f 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -452,17 +452,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) diff --git a/src/login/logind-user.c b/src/login/logind-user.c index b6daf6529..1814a0e8f 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -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; } |