From: Zbigniew Jędrzejewski-Szmek Date: Thu, 18 May 2023 15:05:41 +0000 (+0200) Subject: sd-bus,sd-event: allow querying of description even after fork X-Git-Tag: v254-rc1~444^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed7a6f51eab5af40d3d7884ce846f74aea0c00f0;p=thirdparty%2Fsystemd.git sd-bus,sd-event: allow querying of description even after fork This in unnecessarilly unpleasant: the code might report about a bus connection, e.g. in an error message or assert. Let's let it query the name of the object. This partially reverts f4b2933ee7890e5d414ab266d8586f19027a2bd9. --- diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index f9a195d2edc..91e7505cd95 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -4198,7 +4198,6 @@ _public_ int sd_bus_get_description(sd_bus *bus, const char **description) { assert_return(bus, -EINVAL); assert_return(bus = bus_resolve(bus), -ENOPKG); assert_return(description, -EINVAL); - assert_return(!bus_origin_changed(bus), -ECHILD); const char *d = bus->description; if (!d) diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index 73731294fb3..1224654290c 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -2603,7 +2603,6 @@ _public_ int sd_event_source_set_description(sd_event_source *s, const char *des _public_ int sd_event_source_get_description(sd_event_source *s, const char **description) { assert_return(s, -EINVAL); assert_return(description, -EINVAL); - assert_return(!event_origin_changed(s->event), -ECHILD); if (!s->description) return -ENXIO;