8d419f
From f2ca27c7fa3e98cbb412871d7ea18b51e7f5f048 Mon Sep 17 00:00:00 2001
8d419f
From: Yu Watanabe <watanabe.yu+github@gmail.com>
8d419f
Date: Sun, 17 Apr 2022 07:29:24 +0900
8d419f
Subject: [PATCH] sd-bus: do not return negative errno when unknown name is
8d419f
 specified
8d419f
8d419f
When 'recursive' is false, then sd_bus_track_remove_name() does not
8d419f
return negative errno when unknown name is specified. Let's follow the
8d419f
same pattern for the case that 'recursive' is true.
8d419f
8d419f
(cherry picked from commit 55bfacc6c33eaf3475762e71172b2ef504be5af8)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 src/libsystemd/sd-bus/bus-track.c | 5 +----
8d419f
 1 file changed, 1 insertion(+), 4 deletions(-)
8d419f
8d419f
diff --git a/src/libsystemd/sd-bus/bus-track.c b/src/libsystemd/sd-bus/bus-track.c
8d419f
index 1cbdb46f4c..c56bd03fc6 100644
8d419f
--- a/src/libsystemd/sd-bus/bus-track.c
8d419f
+++ b/src/libsystemd/sd-bus/bus-track.c
8d419f
@@ -256,12 +256,9 @@ _public_ int sd_bus_track_remove_name(sd_bus_track *track, const char *name) {
8d419f
         if (!track) /* Treat a NULL track object as an empty track object */
8d419f
                 return 0;
8d419f
 
8d419f
-        if (!track->recursive)
8d419f
-                return bus_track_remove_name_fully(track, name);
8d419f
-
8d419f
         i = hashmap_get(track->names, name);
8d419f
         if (!i)
8d419f
-                return -EUNATCH;
8d419f
+                return 0;
8d419f
 
8d419f
         assert(i->n_ref >= 1);
8d419f
         if (i->n_ref <= 1)