summaryrefslogtreecommitdiff
path: root/lib/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common.sh')
-rw-r--r--lib/common.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/common.sh b/lib/common.sh
index 455e841..7f83bdd 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -145,7 +145,7 @@ lock() {
local mesg=("${@:3}")
# Only reopen the FD if it wasn't handed to us
- if [[ "$(readlink -f /dev/fd/$fd)" != "$(readlink -f "$file")" ]]; then
+ if ! [[ "/dev/fd/$fd" -ef "$file" ]]; then
mkdir -p "${file%/*}"
eval "exec $fd>"'"$file"'
fi
@@ -166,7 +166,7 @@ slock() {
local mesg=("${@:3}")
# Only reopen the FD if it wasn't handed to us
- if [[ "$(readlink -f /dev/fd/$fd)" != "$(readlink -f "$file")" ]]; then
+ if ! [[ "/dev/fd/$fd" -ef "$file" ]]; then
mkdir -p "${file%/*}"
eval "exec $fd>"'"$file"'
fi