From 0c15decc00f3f340de7fe711ca610d65de4e48e2 Mon Sep 17 00:00:00 2001 From: eschnett Date: Fri, 14 Sep 2012 18:21:33 +0000 Subject: Abort gracefully if lock file cannot be created git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@224 83718e91-0e4f-0410-abf4-91180603181f --- src/util/git-lock.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/git-lock.pl b/src/util/git-lock.pl index 9980833..7fdbed5 100755 --- a/src/util/git-lock.pl +++ b/src/util/git-lock.pl @@ -6,6 +6,7 @@ use strict; use Cwd; +use POSIX; #use Fcntl ':flock'; use sigtrap qw(die normal-signals); @@ -32,6 +33,7 @@ my $lockdir = "$git_dir/GITLOCK"; my $waittime = 0.01; my $maxwaittime = 10; while (! (mkdir $lockdir)) { + die if $! != EEXIST; # Wait some time my $unit = $waittime==1 ? "second" : "seconds"; print "Git repository is busy; waiting $waittime $unit...\n"; -- cgit v1.2.3