From bc6a6232481bf1e977de08e1eebecdcf28391cf8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 10 Jan 2014 13:35:12 +0800 Subject: bus: convert a bus error with NULL name into an errno of 0 in sd_bus_error_get_errno() --- src/libsystemd-bus/bus-error.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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); } -- cgit v1.2.3-54-g00ecf