]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: do not return negative errno when unknown name is specified
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 16 Apr 2022 22:29:24 +0000 (07:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Apr 2022 09:02:10 +0000 (18:02 +0900)
When 'recursive' is false, then sd_bus_track_remove_name() does not
return negative errno when unknown name is specified. Let's follow the
same pattern for the case that 'recursive' is true.

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

index 1cbdb46f4c4bb525158030c595d27ceccdcf558e..c56bd03fc66fa481f0fbc6952e4de968aaed547d 100644 (file)
@@ -256,12 +256,9 @@ _public_ int sd_bus_track_remove_name(sd_bus_track *track, const char *name) {
         if (!track) /* Treat a NULL track object as an empty track object */
                 return 0;
 
-        if (!track->recursive)
-                return bus_track_remove_name_fully(track, name);
-
         i = hashmap_get(track->names, name);
         if (!i)
-                return -EUNATCH;
+                return 0;
 
         assert(i->n_ref >= 1);
         if (i->n_ref <= 1)