From 1ed79f5432d0bd4c4f0c8f8692b488c268e379a4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 30 Mar 2019 19:03:24 +0100 Subject: [PATCH] lock: Cleanup lock files Signed-off-by: Michael Tremer --- src/functions/functions.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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} } -- 2.39.2