mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +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++) {
|
||||
close(x);
|
||||
}
|
||||
res = system(s);
|
||||
exit(res);
|
||||
res = execl("/bin/sh", "/bin/sh", "-c", s, NULL);
|
||||
exit(1);
|
||||
} else if (pid > 0) {
|
||||
for(;;) {
|
||||
res = wait4(pid, &status, 0, &rusage);
|
||||
|
||||
Reference in New Issue
Block a user