bugfix: resty: we should check the case when exec() fails. thanks Michal Cichra for the original patch in #65.

This commit is contained in:
Yichun Zhang (agentzh) 2014-09-10 13:24:18 -07:00
parent c7eea80684
commit 07913609c6
1 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,8 @@ if (!-f $nginx_path) {
}
if ($opts{V}) {
exec "$nginx_path -V";
my $cmd = "$nginx_path -V";
exec $cmd or die "Failed to run command \"$cmd\": $!\n";
}
my $lua_package_path_config = '';
@ -259,7 +260,7 @@ if (!defined $pid) {
if ($pid == 0) { # child process
#warn "exec $cmd...";
exec $cmd;
exec $cmd or die "Failed to run command \"$cmd\": $!\n";
} else {
$child_pid = $pid;