From d2acee68f4648cec849079ad3f7695c4a8170b01 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Mon, 14 Feb 2022 19:42:56 +0900 Subject: [PATCH] include/ipc: Fix bug in unsubscribe logic when closing an endpoint When `ipc_endpoint_close()` attempts to remove all subscriptions of an endpoint, the list that it iterates over includes the directory containing the subscriptions, causing the function to emit an error. This commit fixes the way that `ipc_endpoint_close()` determines the list of subscriptions to be removed. --- include/ipc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ipc.sh b/include/ipc.sh index 642f6bc..c87baf7 100644 --- a/include/ipc.sh +++ b/include/ipc.sh @@ -515,9 +515,9 @@ ipc_endpoint_close() { while read -r subscription; do if ! rm "$subscription/${name//\//_}"; then - log_error "Could unsubscribe $name from $subscription" + log_error "Could not unsubscribe $name from $subscription" fi - done < <(find "$endpoint/subscriptions") + done < <(find "$endpoint/subscriptions" -mindepth 1 -maxdepth 1 -type l) if ! rm -rf "$endpoint"; then return 1 -- 2.47.3