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