summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-error.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/bus-error.c')
-rw-r--r--src/libsystemd-bus/bus-error.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-error.c b/src/libsystemd-bus/bus-error.c
index 55b418768a..5faa17384e 100644
--- a/src/libsystemd-bus/bus-error.c
+++ b/src/libsystemd-bus/bus-error.c
@@ -168,3 +168,10 @@ int bus_error_from_errno(sd_bus_error *e, int error) {
return error;
}
+
+const char *bus_error_message(const sd_bus_error *e, int error) {
+ if (e && e->message)
+ return e->message;
+
+ return strerror(error);
+}