From 55bfacc6c33eaf3475762e71172b2ef504be5af8 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sun, 17 Apr 2022 07:29:24 +0900
Subject: [PATCH] sd-bus: do not return negative errno when unknown name is
 specified
 
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 | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
 
diff --git a/src/libsystemd/sd-bus/bus-track.c b/src/libsystemd/sd-bus/bus-track.c
index 1cbdb46f4c..c56bd03fc6 100644
--- a/src/libsystemd/sd-bus/bus-track.c
+++ b/src/libsystemd/sd-bus/bus-track.c
@@ -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)
-- 
2.33.0
 
