diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-02-03 19:31:53 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-02-05 19:00:36 -0500 |
commit | 90b2de37b80603168f4e9c9c81cff7eea4efa21a (patch) | |
tree | c94767aff1f78fe52fc33ba697d265dcccb4786c /src/login/logind-session.c | |
parent | 284c0b917697fb0271381f331ffee28403278e72 (diff) |
Update some message formats
Use PID_FMT/USEC_FMT/... in more places.
Also update logind error messages to print the full path to a file that
failed. This should make debugging easier for people who do not know
off the top of their head where logind stores it state.
Diffstat (limited to 'src/login/logind-session.c')
-rw-r--r-- | src/login/logind-session.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c index ca2e48570c..bec59c044b 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -186,12 +186,12 @@ int session_save(Session *s) { fprintf(f, "# This is private data. Do not parse.\n" - "UID=%lu\n" + "UID="UID_FMT"\n" "USER=%s\n" "ACTIVE=%i\n" "STATE=%s\n" "REMOTE=%i\n", - (unsigned long) s->user->uid, + s->user->uid, s->user->name, session_is_active(s), session_state_to_string(session_get_state(s)), @@ -240,17 +240,17 @@ int session_save(Session *s) { fprintf(f, "POS=%u\n", s->pos); if (s->leader > 0) - fprintf(f, "LEADER=%lu\n", (unsigned long) s->leader); + fprintf(f, "LEADER="PID_FMT"\n", s->leader); if (s->audit_id > 0) fprintf(f, "AUDIT=%"PRIu32"\n", s->audit_id); if (dual_timestamp_is_set(&s->timestamp)) fprintf(f, - "REALTIME=%llu\n" - "MONOTONIC=%llu\n", - (unsigned long long) s->timestamp.realtime, - (unsigned long long) s->timestamp.monotonic); + "REALTIME="USEC_FMT"\n" + "MONOTONIC="USEC_FMT"\n", + s->timestamp.realtime, + s->timestamp.monotonic); if (s->controller) fprintf(f, "CONTROLLER=%s\n", s->controller); @@ -265,7 +265,7 @@ int session_save(Session *s) { finish: if (r < 0) - log_error("Failed to save session data for %s: %s", s->id, strerror(-r)); + log_error("Failed to save session data %s: %s", s->state_file, strerror(-r)); return r; } |