diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-02-06 02:53:18 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-03-25 12:31:45 -0400 |
commit | bde110be503c714b8bbbc85b3200e498be5423ec (patch) | |
tree | 209dc5face89fd2169de41096d5d7ad347df0737 /lib | |
parent | baf8ae6d8d185c980aca65e0ae772a0ad5d2fb61 (diff) | |
download | devtools32-bde110be503c714b8bbbc85b3200e498be5423ec.tar.xz |
lib/common.sh: lock, slock: Create directories for locks if necessary.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common.sh | 2 |
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 |