summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus
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/libsystemd-bus
parent46e65dcc3a522b5e992e165b5e61d14254026859 (diff)
bus: log message parsing errors everywhere with a generalized bus_log_parse_error()
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r--src/libsystemd-bus/bus-util.c5
-rw-r--r--src/libsystemd-bus/bus-util.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 2b1cd0bc83..ae9733d01f 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -953,3 +953,8 @@ int bus_property_get_uid(
return sd_bus_message_append_basic(reply, 'u', userdata);
}
+
+int bus_log_parse_error(int r) {
+ log_error("Failed to parse message: %s", strerror(-r));
+ return r;
+}
diff --git a/src/libsystemd-bus/bus-util.h b/src/libsystemd-bus/bus-util.h
index f982e08ecd..5f0a0b3ffa 100644
--- a/src/libsystemd-bus/bus-util.h
+++ b/src/libsystemd-bus/bus-util.h
@@ -75,6 +75,8 @@ int bus_property_get_uid(sd_bus *bus, const char *path, const char *interface, c
#define bus_property_get_gid bus_property_get_uid
#define bus_property_get_pid bus_property_get_uid
+int bus_log_parse_error(int r);
+
DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus*, sd_bus_unref);
DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_message*, sd_bus_message_unref);