summaryrefslogtreecommitdiff
path: root/lib/common.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-03-25 12:34:40 -0400
committerJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2017-04-05 22:03:00 +0200
commitd4f09b2c7b36c78500bec769c98ebc04c0a19e7d (patch)
tree209dc5face89fd2169de41096d5d7ad347df0737 /lib/common.sh
parentd33344081006d3f653651f0895b143c305e9e7c7 (diff)
downloaddevtools32-d4f09b2c7b36c78500bec769c98ebc04c0a19e7d.tar.xz
lib/common.sh: lock, slock: Create directories for locks if necessary.
Diffstat (limited to 'lib/common.sh')
-rw-r--r--lib/common.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/common.sh b/lib/common.sh
index 63b7795..6d873ed 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -140,6 +140,7 @@ get_full_version() {
lock() {
# Only reopen the FD if it wasn't handed to us
if ! [[ "/dev/fd/$1" -ef "$2" ]]; then
+ mkdir -p -- "$(dirname -- "$2")"
eval "exec $1>"'"$2"'
fi
@@ -156,6 +157,7 @@ lock() {
slock() {
# Only reopen the FD if it wasn't handed to us
if ! [[ "/dev/fd/$1" -ef "$2" ]]; then
+ mkdir -p -- "$(dirname -- "$2")"
eval "exec $1>"'"$2"'
fi