]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus,sd-event: allow querying of description even after fork
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 May 2023 15:05:41 +0000 (17:05 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 May 2023 15:20:15 +0000 (17:20 +0200)
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.

src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-event/sd-event.c

index f9a195d2edcb0a01ad3f7763a8014cb806ab6cb6..91e7505cd95eba15e83cad23e274ab7b2805fc7e 100644 (file)
@@ -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)
index 73731294fb38bb00d25f1076ebfa90160e6a11dc..1224654290c7126307637d7640f0c24c0cf4af8f 100644 (file)
@@ -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;