X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-user.c;h=a89d1bef7838cc834a230eb13b5bac5a23194f7f;hp=b6daf65296920c8285e903ddd2506002f988c828;hb=d49b80008fd8c0952da67bee0dc8a1314f29b8a7;hpb=03aeb1036dde68c309cb2afb9e5d523c60629115;ds=sidebyside diff --git a/src/login/logind-user.c b/src/login/logind-user.c index b6daf6529..a89d1bef7 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -124,6 +124,7 @@ User *user_free(User *u) { u->slice_job = mfree(u->slice_job); u->service_job = mfree(u->service_job); #endif // 0 + u->service = mfree(u->service); u->slice = mfree(u->slice); u->runtime_path = mfree(u->runtime_path); @@ -326,17 +327,10 @@ 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; - } + if (realtime) + timestamp_deserialize(realtime, &u->timestamp.realtime); + if (monotonic) + timestamp_deserialize(monotonic, &u->timestamp.monotonic); return r; } @@ -390,7 +384,7 @@ static int user_mkdir_runtime_path(User *u) { return 0; fail: - /* Try to clean up, but ignore errors */ + /* Try to clean up, but ignore errors */ (void) rmdir(u->runtime_path); return r; } @@ -446,11 +440,11 @@ static int user_start_service(User *u) { u->service, &error, &job); - if (r < 0) { + if (r < 0) { /* we don't fail due to this, let's try to continue */ log_error_errno(r, "Failed to start user service, ignoring: %s", bus_error_message(&error, r)); - } else { - u->service_job = job; + } else { + u->service_job = job; } #else assert(u);