version 1.230, 2010/12/14 11:59:06 |
version 1.231, 2011/01/06 23:01:35 |
|
|
char *shell; |
char *shell; |
pid_t pid; |
pid_t pid; |
int status; |
int status; |
|
void (*osighand)(int); |
|
|
if (!options.permit_local_command || |
if (!options.permit_local_command || |
args == NULL || !*args) |
args == NULL || !*args) |
|
|
if ((shell = getenv("SHELL")) == NULL || *shell == '\0') |
if ((shell = getenv("SHELL")) == NULL || *shell == '\0') |
shell = _PATH_BSHELL; |
shell = _PATH_BSHELL; |
|
|
|
osighand = signal(SIGCHLD, SIG_DFL); |
pid = fork(); |
pid = fork(); |
if (pid == 0) { |
if (pid == 0) { |
debug3("Executing %s -c \"%s\"", shell, args); |
debug3("Executing %s -c \"%s\"", shell, args); |
|
|
while (waitpid(pid, &status, 0) == -1) |
while (waitpid(pid, &status, 0) == -1) |
if (errno != EINTR) |
if (errno != EINTR) |
fatal("Couldn't wait for child: %s", strerror(errno)); |
fatal("Couldn't wait for child: %s", strerror(errno)); |
|
signal(SIGCHLD, osighand); |
|
|
if (!WIFEXITED(status)) |
if (!WIFEXITED(status)) |
return (1); |
return (1); |