From dbee2e2f50e35fdd2654c9c2c59296f275a5fcb4 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 7 Jul 2008 09:16:03 +0000 Subject: [PATCH] Add a "trap" command so that the script erases its lock file even if it exists prematurely. --- Scripts/developer_scripts/autotest_cgal_with_cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/developer_scripts/autotest_cgal_with_cmake b/Scripts/developer_scripts/autotest_cgal_with_cmake index d394adb7f6b..206c8fe97f0 100755 --- a/Scripts/developer_scripts/autotest_cgal_with_cmake +++ b/Scripts/developer_scripts/autotest_cgal_with_cmake @@ -706,6 +706,9 @@ else MAKE_CMD='make' fi +# that line makes the script remove the lock file in case of unwanted exit +trap "rm -f $LOCK_FILE" EXIT HUP INT TERM + # Acquire lock lockfile -r 5 "$LOCK_FILE"; if [ ${?} != 0 ]; then