speed up exec() in ltlcross and ltldo
exec_with_timeout()
could be speed up in at least two ways.
- Try
execv("/bin/sh",...)
first and only resort toexecvp("sh",...)
if the first fails. This avoids the PATH lookup.
The first try should probably honor the SHELL variable if it is defined.
- If the command is simple enough so that we can split it by ourselves (a single command with redirection, maybe single-quoted strings and double-quoted strings that do not contain dollars, backaslashs or backquotes, no variable assignment), then we can run the command directly with
execvp
without starting a shell. GNU make has some code that does exactly that.