|
a/src/utils/execmd.cpp |
|
b/src/utils/execmd.cpp |
|
... |
|
... |
538 |
envv[i++] = 0;
|
538 |
envv[i++] = 0;
|
539 |
|
539 |
|
540 |
// As we are going to use execve, not execvp, do the PATH thing.
|
540 |
// As we are going to use execve, not execvp, do the PATH thing.
|
541 |
string exe;
|
541 |
string exe;
|
542 |
if (!which(cmd, exe)) {
|
542 |
if (!which(cmd, exe)) {
|
543 |
LOGERR("ExecCmd::startExec: " << (cmd) << " not found\n");
|
543 |
LOGERR("ExecCmd::startExec: " << cmd << " not found\n");
|
544 |
free(argv);
|
544 |
free(argv);
|
545 |
free(envv);
|
545 |
free(envv);
|
546 |
return -1;
|
546 |
return 127 << 8;
|
547 |
}
|
547 |
}
|
548 |
//////////////////////////////// End vfork child prepare section.
|
548 |
//////////////////////////////// End vfork child prepare section.
|
549 |
|
549 |
|
550 |
#if HAVE_POSIX_SPAWN && USE_POSIX_SPAWN
|
550 |
#if HAVE_POSIX_SPAWN && USE_POSIX_SPAWN
|
551 |
// Note that posix_spawn provides no way to setrlimit() the child.
|
551 |
// Note that posix_spawn provides no way to setrlimit() the child.
|
|
... |
|
... |
763 |
|
763 |
|
764 |
|
764 |
|
765 |
int ExecCmd::doexec(const string& cmd, const vector<string>& args,
|
765 |
int ExecCmd::doexec(const string& cmd, const vector<string>& args,
|
766 |
const string *input, string *output)
|
766 |
const string *input, string *output)
|
767 |
{
|
767 |
{
|
768 |
|
|
|
769 |
if (startExec(cmd, args, input != 0, output != 0) < 0) {
|
768 |
int status = startExec(cmd, args, input != 0, output != 0);
|
|
|
769 |
if (status) {
|
770 |
return -1;
|
770 |
return status;
|
771 |
}
|
771 |
}
|
772 |
|
772 |
|
773 |
// Cleanup in case we return early
|
773 |
// Cleanup in case we return early
|
774 |
ExecCmdRsrc e(m);
|
774 |
ExecCmdRsrc e(m);
|
775 |
SelectLoop myloop;
|
775 |
SelectLoop myloop;
|