Francois Gouget : winetest: Make sure the cron script releases the lock once done.

Alexandre Julliard julliard at winehq.org
Fri Feb 19 16:42:31 CST 2021


Module: tools
Branch: master
Commit: b13e278b0a85ae8be08f55dcf66c16651dcf02a9
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=b13e278b0a85ae8be08f55dcf66c16651dcf02a9

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri Feb 19 01:37:03 2021 +0100

winetest: Make sure the cron script releases the lock once done.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 winetest/winetest.cron | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/winetest/winetest.cron b/winetest/winetest.cron
index 7418f9e..6119013 100755
--- a/winetest/winetest.cron
+++ b/winetest/winetest.cron
@@ -31,6 +31,10 @@ then
     exit 1
 fi
 lock="/tmp/winetest.lock"
+cleanup()
+{
+    rm -f "$lock"
+}
 
 # expiration age (in days) before results get archived
 expire=120
@@ -38,6 +42,7 @@ expire=120
 if [ ! -f "$lock" ]
 then
     touch "$lock"
+    trap cleanup EXIT
     cd "$workdir"
 
     refresh_index=""
@@ -87,6 +92,4 @@ then
     # remove old queue files
     find queue -maxdepth 1 -mtime +30 -name "err*" -print0 | xargs -0 rm -rf
     find queue -maxdepth 1 -mtime +30 -name "CGI*" -print0 | xargs -0 rm -f
-
-    rm "$lock"
 fi




More information about the wine-cvs mailing list