From 050a8d39b9ca831073520316dbc197270b11720d Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 28 Aug 2014 13:33:28 -0400 Subject: [PATCH] Complain and fail if exec() returns. No issue # --- sdk/cli/bin/crunch-job | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job index 4d2aad997a..402c2de60e 100755 --- a/sdk/cli/bin/crunch-job +++ b/sdk/cli/bin/crunch-job @@ -1493,8 +1493,12 @@ for my $dir ($destdir, $task_work) { open L, ">", "$destdir.lock" or die "$destdir.lock: $!"; flock L, LOCK_EX; if (readlink ("$destdir.commit") eq $commit && -d $destdir) { - exec(@ARGV) if @ARGV; - exit 0; + if (@ARGV) { + exec(@ARGV); + die "Cannot exec `@ARGV`: $!"; + } else { + exit 0; + } } unlink "$destdir.commit"; @@ -1542,6 +1546,7 @@ close L; if (@ARGV) { exec(@ARGV); + die "Cannot exec `@ARGV`: $!"; } else { exit 0; } -- 2.30.2