diff options
author | eschnett <eschnett@83718e91-0e4f-0410-abf4-91180603181f> | 2012-09-14 18:21:33 +0000 |
---|---|---|
committer | eschnett <eschnett@83718e91-0e4f-0410-abf4-91180603181f> | 2012-09-14 18:21:33 +0000 |
commit | 0c15decc00f3f340de7fe711ca610d65de4e48e2 (patch) | |
tree | 27d772c0efd3d6b08f1c0eadb3e8c91d8adc54ca | |
parent | b881b2fc8fa251c91a15b8d026f794a8c1d59b4e (diff) |
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
-rwxr-xr-x | src/util/git-lock.pl | 2 |
1 files changed, 2 insertions, 0 deletions
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"; |