]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't modify things if we are using vfork as this is very bad and may cause unexpecte...
authorJoshua Colp <jcolp@digium.com>
Wed, 18 Oct 2006 21:03:34 +0000 (21:03 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 18 Oct 2006 21:03:34 +0000 (21:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45595 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c

index 75426fe4ec7a00e8e2e4e86974cab3d25b71d12a..941d2112982d4c697bceb5e7e81c642fafa41f00 100644 (file)
@@ -690,7 +690,9 @@ void ast_unreplace_sigchld(void)
 int ast_safe_system(const char *s)
 {
        pid_t pid;
+#ifdef HAVE_WORKING_FORK
        int x;
+#endif
        int res;
        struct rusage rusage;
        int status;
@@ -705,11 +707,13 @@ int ast_safe_system(const char *s)
 #endif 
 
        if (pid == 0) {
+#ifdef HAVE_WORKING_FORK
                if (ast_opt_high_priority)
                        ast_set_priority(0);
                /* Close file descriptors and launch system command */
                for (x = STDERR_FILENO + 1; x < 4096; x++)
                        close(x);
+#endif
                execl("/bin/sh", "/bin/sh", "-c", s, (char *) NULL);
                exit(1);
        } else if (pid > 0) {