diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-01-10 13:35:12 +0800 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-01-10 13:35:51 +0800 |
commit | bc6a6232481bf1e977de08e1eebecdcf28391cf8 (patch) | |
tree | 0cb6f1f1dde1f925abed1326ca8184dcea143bde | |
parent | c5b37953b7835562348d71ad5514faefa4cfb10b (diff) |
bus: convert a bus error with NULL name into an errno of 0 in sd_bus_error_get_errno()
-rw-r--r-- | src/libsystemd-bus/bus-error.c | 3 |
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); } |