From e23bde303bc1961a72857dd598665c17f5ed7388 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sat, 8 Oct 2022 17:21:45 +0900 Subject: [PATCH] include/wmutex: Don't write to stderr when wmutex_unlock() fails When a wmutex could not be unlocked, the rm call in wmutex_unlock() writes an error message directly to stderr. However, the function should only return an error without writing to stderr. This commit modifies wmutex_unlock() so that it does not write to stderr. --- include/wmutex.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wmutex.sh b/include/wmutex.sh index 3ce6f2d..1ba68d7 100644 --- a/include/wmutex.sh +++ b/include/wmutex.sh @@ -52,7 +52,7 @@ wmutex_lock() { wmutex_unlock() { local lock="$1" - if ! rm "$lock"; then + if ! rm "$lock" 2>/dev/null; then return 1 fi -- 2.47.3