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