From f5a7739171a877dfb29876d673d1720a1c9bf6bc Mon Sep 17 00:00:00 2001 From: Jude Taylor Date: Wed, 21 Oct 2015 14:38:35 -0700 Subject: appropriately handle lock acquisition failures in resolve-system-dependencies.pl --- scripts/resolve-system-dependencies.pl.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts/resolve-system-dependencies.pl.in') diff --git a/scripts/resolve-system-dependencies.pl.in b/scripts/resolve-system-dependencies.pl.in index 412f07274..1294ebba5 100755 --- a/scripts/resolve-system-dependencies.pl.in +++ b/scripts/resolve-system-dependencies.pl.in @@ -4,6 +4,7 @@ use utf8; use strict; use warnings; use Cwd qw(realpath); +use Errno; use File::Basename qw(dirname); use File::Path qw(make_path); use File::Spec::Functions qw(catfile); @@ -24,10 +25,14 @@ make_path dirname($cache); our $DEPS; eval { $DEPS = lock_retrieve($cache); -} or do { +}; + +if($!{ENOENT}) { lock_store {}, $cache; $DEPS = {}; -}; +} elsif($@) { + die "Unable to obtain a lock on dependency-map file $cache: $@"; +} sub mkset(@) { my %set; -- cgit v1.2.3