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