From ad5a0cc59ccf5c0927323db081686f902cbbca28 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Dec 2012 20:39:58 -0500 Subject: lib/common.sh: create directories for locks if they don't exist --- lib/common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common.sh b/lib/common.sh index 5204091..932799e 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -113,6 +113,7 @@ lock_open_write() { # Only reopen the FD if it wasn't handed to us if [[ $(readlink -f /dev/fd/$fd) != "${path}.lock" ]]; then + mkdir -p "${path%/*}" eval "exec $fd>${path}.lock" fi @@ -133,6 +134,7 @@ lock_open_read() { # Only reopen the FD if it wasn't handed to us if [[ $(readlink -f /dev/fd/$fd) != "${path}.lock" ]]; then + mkdir -p "${path%/*}" eval "exec $fd>${path}.lock" fi -- cgit v1.2.3-70-g09d2