]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.lock
lock: Cleanup lock files
[people/ms/network.git] / src / functions / functions.lock
index fd15e5e327c5feae1990dc67a3983bc635cd2289..c01fcf3542c011ea5c7061ce7fd3592a8d94951e 100644 (file)
@@ -29,6 +29,7 @@ lock() {
        fi
 
        local timeout="60"
+       local ret=0
 
        # Make partent directory
        make_parent_directory "${lock}"
@@ -53,5 +54,10 @@ lock() {
                log DEBUG "Released lock ${lock}"
 
                exit ${ret}
-       ) 9>${lock} || exit $?
+       ) 9>${lock} || ret=$?
+
+       # Cleanup log file
+       file_delete "${lock}"
+
+       return ${ret}
 }