diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-10 18:08:49 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-10 19:12:30 -0400 |
commit | 04995cbe1c4e7494b65a63f223e5e2ddfd789e33 (patch) | |
tree | 226cabd41dc5e84a90ae1e1119410713931e0f4c /lib/common.sh | |
parent | 33730fc272bec6376a28d8f813e9e35ec4f84175 (diff) |
lib/common.sh: Use `[[ a -ef b ]]` instead of double calls to `readlink -f`
Diffstat (limited to 'lib/common.sh')
-rw-r--r-- | lib/common.sh | 4 |
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 |