]> git.corax.cc Git - toolbox/commitdiff
include/ipc: Fix bug in unsubscribe logic when closing an endpoint
authorMatthias Kruk <m@m10k.eu>
Mon, 14 Feb 2022 10:42:56 +0000 (19:42 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 14 Feb 2022 10:42:56 +0000 (19:42 +0900)
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

index 642f6bcde4c7027f498b364ec289f1c1a9202a9b..c87baf7750a1519c58c78da9a330f9960579316d 100644 (file)
@@ -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