[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: t/runtests: Fix mkdir race condition



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit fa709cea351dbd7bc1745d8e4fb63515bf491893
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Apr 16 07:12:36 2014 +0200

    t/runtests: Fix mkdir race condition
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 t/runtests | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/t/runtests b/t/runtests
index 8056c2a..a83230b 100755
--- a/t/runtests
+++ b/t/runtests
@@ -636,7 +636,9 @@ sub test_changes {
         }
     }
 
-    mkdir("$RUNDIR/changes")
+    # Use mkdir -p to avoid a race condition where two threads tries
+    # to create the same dir and then have one of them error out.
+    runsystem_ok('mkdir', '-p', "$RUNDIR/changes")
       if not -d "$RUNDIR/changes";
 
     msg_print "Running $testname $testdata->{version}... ";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: