summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2006-10-18 21:05:52 +0000
committerJoshua Colp <jcolp@digium.com>2006-10-18 21:05:52 +0000
commit0ff90f87c54547d5f36612409ba70e0a96222c75 (patch)
treefb834ec77ed136dd62b1124418577a48fb586492 /main/asterisk.c
parentc046fb40d8e7959ef2601268dc5656158cf3032d (diff)
Merged revisions 45595 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45595 | file | 2006-10-18 17:03:34 -0400 (Wed, 18 Oct 2006) | 2 lines Don't modify things if we are using vfork as this is very bad and may cause unexpected behavior (issue #7970 reported by Nick Gavrikov) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index d80b3dea5..44bea2812 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -643,7 +643,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;
@@ -658,11 +660,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) {