From: Michael Tremer Date: Sat, 30 Mar 2019 18:03:24 +0000 (+0100) Subject: lock: Cleanup lock files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ed79f5432d0bd4c4f0c8f8692b488c268e379a4;p=network.git lock: Cleanup lock files Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.lock b/src/functions/functions.lock index fd15e5e3..c01fcf35 100644 --- a/src/functions/functions.lock +++ b/src/functions/functions.lock @@ -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} }