summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mutex.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mutex.sh b/src/mutex.sh
index 4aa8e1f..be63d96 100644
--- a/src/mutex.sh
+++ b/src/mutex.sh
@@ -22,9 +22,8 @@ _mutex_trylock()
{
local mutex="${1}"
- (set -C; printf '%d\n' "${$}" >"${mutex}") 2>/dev/null
-
- return ${?}
+ (set -C; printf '%d\n' "${$}" >"${mutex}") 2>/dev/null || return ${?}
+ return 0
}
mutex_timedlock()
@@ -52,7 +51,6 @@ mutex_is_unlockable()
{
local mutex="${1}"
- [ "x$(cat "${mutex}" 2>/dev/null)" = "x${$}" ]
-
- return ${?}
+ [ "x$(cat "${mutex}" 2>/dev/null)" = "x${$}" ] || return ${?}
+ return 0
}