From: Matthias Kruk Date: Mon, 14 Feb 2022 10:42:56 +0000 (+0900) Subject: include/ipc: Fix bug in unsubscribe logic when closing an endpoint X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=d2acee68f4648cec849079ad3f7695c4a8170b01;p=toolbox 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. --- 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