summaryrefslogtreecommitdiff
path: root/src/update-utmp/update-utmp.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-07 21:26:31 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 21:26:31 +0100
commit5b30bef856e89a571df57b7b953e9a1409d9aced (patch)
tree815d8648bf7b59a35c1cda35174b8b1e08cac323 /src/update-utmp/update-utmp.c
parent46e65dcc3a522b5e992e165b5e61d14254026859 (diff)
bus: log message parsing errors everywhere with a generalized bus_log_parse_error()
Diffstat (limited to 'src/update-utmp/update-utmp.c')
-rw-r--r--src/update-utmp/update-utmp.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c
index 61db1e96d3..42554fe2dc 100644
--- a/src/update-utmp/update-utmp.c
+++ b/src/update-utmp/update-utmp.c
@@ -71,9 +71,8 @@ static usec_t get_startup_time(Context *c) {
}
r = sd_bus_message_read(reply, "v", "t", &t);
- if (r < 0) {
- log_error("Failed to parse reply: %s", strerror(-r));
- }
+ if (r < 0)
+ return bus_log_parse_error(r);
return t;
}
@@ -123,10 +122,8 @@ static int get_current_runlevel(Context *c) {
}
r = sd_bus_message_read(reply1, "o", &path);
- if (r < 0) {
- log_error("Failed to parse reply: %s", strerror(-r));
- return -EIO;
- }
+ if (r < 0)
+ return bus_log_parse_error(r);
r = sd_bus_call_method(
c->bus,
@@ -143,10 +140,8 @@ static int get_current_runlevel(Context *c) {
}
r = sd_bus_message_read(reply2, "v", "s", &state);
- if (r < 0) {
- log_error("Failed to parse reply: %s", strerror(-r));
- return -EIO;
- }
+ if (r < 0)
+ return bus_log_parse_error(r);
if (streq(state, "active") || streq(state, "reloading"))
return table[i].runlevel;