Improve ast_safe_system
authorMark Spencer <markster@digium.com>
Tue, 23 Mar 2004 21:55:46 +0000 (21:55 +0000)
committerMark Spencer <markster@digium.com>
Tue, 23 Mar 2004 21:55:46 +0000 (21:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2541 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c

index 5e1d812..a714d54 100755 (executable)
@@ -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);