mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-31 18:55:19 +00:00
Improve ast_safe_system
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -168,8 +168,8 @@ int ast_safe_system(const char *s)
|
|||||||
for (x=STDERR_FILENO + 1; x<4096;x++) {
|
for (x=STDERR_FILENO + 1; x<4096;x++) {
|
||||||
close(x);
|
close(x);
|
||||||
}
|
}
|
||||||
res = system(s);
|
res = execl("/bin/sh", "/bin/sh", "-c", s, NULL);
|
||||||
exit(res);
|
exit(1);
|
||||||
} else if (pid > 0) {
|
} else if (pid > 0) {
|
||||||
for(;;) {
|
for(;;) {
|
||||||
res = wait4(pid, &status, 0, &rusage);
|
res = wait4(pid, &status, 0, &rusage);
|
||||||
|
|||||||
Reference in New Issue
Block a user