summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-error.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-10 13:35:12 +0800
committerLennart Poettering <lennart@poettering.net>2014-01-10 13:35:51 +0800
commitbc6a6232481bf1e977de08e1eebecdcf28391cf8 (patch)
tree0cb6f1f1dde1f925abed1326ca8184dcea143bde /src/libsystemd-bus/bus-error.c
parentc5b37953b7835562348d71ad5514faefa4cfb10b (diff)
bus: convert a bus error with NULL name into an errno of 0 in sd_bus_error_get_errno()
Diffstat (limited to 'src/libsystemd-bus/bus-error.c')
-rw-r--r--src/libsystemd-bus/bus-error.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-error.c b/src/libsystemd-bus/bus-error.c
index 35bd4f0daf..c2e41fb016 100644
--- a/src/libsystemd-bus/bus-error.c
+++ b/src/libsystemd-bus/bus-error.c
@@ -285,6 +285,9 @@ _public_ int sd_bus_error_get_errno(const sd_bus_error* e) {
if (!e)
return 0;
+ if (!e->name)
+ return 0;
+
return bus_error_name_to_errno(e->name);
}