ltlcross: prefer execl("/bin/sh", ...) to execlp("sh", ...)
Fixes #98. * bin/common_trans.cc: Here.
This commit is contained in:
parent
7524e05128
commit
51afd4adfe
1 changed files with 6 additions and 0 deletions
|
|
@ -560,6 +560,12 @@ exec_command(const char* cmd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
use_shell:
|
use_shell:
|
||||||
|
// Try /bin/sh first, because it is faster to not do any PATH
|
||||||
|
// lookup.
|
||||||
|
static bool has_bin_sh = true;
|
||||||
|
if (has_bin_sh)
|
||||||
|
execl("/bin/sh", "sh", "-c", start, nullptr);
|
||||||
|
has_bin_sh = false;
|
||||||
execlp("sh", "sh", "-c", start, nullptr);
|
execlp("sh", "sh", "-c", start, nullptr);
|
||||||
error(2, errno, "failed to run 'sh'");
|
error(2, errno, "failed to run 'sh'");
|
||||||
SPOT_UNREACHABLE();
|
SPOT_UNREACHABLE();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue