From 90b2de37b80603168f4e9c9c81cff7eea4efa21a Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 3 Feb 2014 19:31:53 -0500 Subject: 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. --- src/login/logind-session.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/login/logind-session.c') 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; } -- cgit v1.2.3-54-g00ecf