From f4b2933ee7890e5d414ab266d8586f19027a2bd9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 4 Nov 2014 16:58:42 +0100 Subject: sd-bus,sd-event: unify error handling of object descriptions a) When getting the description return ENXIO if none is set b) Allow setting a description to NULL c) return ECHILD on fork() like for other calls --- src/libsystemd/sd-bus/sd-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsystemd/sd-bus') diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index ba8d5e60fb..a3165fb4f7 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -325,7 +325,6 @@ _public_ int sd_bus_set_trusted(sd_bus *bus, int b) { _public_ int sd_bus_set_description(sd_bus *bus, const char *description) { assert_return(bus, -EINVAL); - assert_return(description, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); assert_return(!bus_pid_changed(bus), -ECHILD); @@ -3316,6 +3315,7 @@ _public_ int sd_bus_try_close(sd_bus *bus) { _public_ int sd_bus_get_description(sd_bus *bus, const char **description) { assert_return(bus, -EINVAL); assert_return(description, -EINVAL); + assert_return(bus->description, -ENXIO); assert_return(!bus_pid_changed(bus), -ECHILD); *description = bus->description; -- cgit v1.2.3-54-g00ecf