summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-10-27 17:42:57 +0000
committerRussell Bryant <russell@russellbryant.com>2006-10-27 17:42:57 +0000
commit4337a82563ad380ca67b96dc712d7a2f1ab94e73 (patch)
treef426c165121ed5212c0627bb7e3329f542247360 /res
parent4a523b1b2d58a1b528790fc8898ce8aec82cc7bb (diff)
Merged revisions 46363 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r46363 | russell | 2006-10-27 12:39:31 -0500 (Fri, 27 Oct 2006) | 5 lines We should always be using _exit() after a fork() or vfork() instead of exit(). This is because exit() does some extra cleanup which in some implementations of vfork(), for example, can actually modify the state of the parent process, causing very weird bugs or crashes. (issue #7971, Nick Gavrikov) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c4
-rw-r--r--res/res_musiconhold.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 686b17ddd..bbb1dc8a9 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -319,7 +319,7 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int *
/* unblock important signal handlers */
if (sigfillset(&signal_set) || pthread_sigmask(SIG_UNBLOCK, &signal_set, NULL)) {
ast_log(LOG_WARNING, "unable to unblock signals for AGI script: %s\n", strerror(errno));
- exit(1);
+ _exit(1);
}
/* Close everything but stdin/out/error */
@@ -332,7 +332,7 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int *
/* Can't use ast_log since FD's are closed */
fprintf(stdout, "verbose \"Failed to execute '%s': %s\" 2\n", script, strerror(errno));
fflush(stdout);
- exit(1);
+ _exit(1);
}
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Launched AGI Script %s\n", script);
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index a8b4d62e8..44cc5498f 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -461,7 +461,7 @@ static int spawn_mp3(struct mohclass *class)
}
ast_log(LOG_WARNING, "Exec failed: %s\n", strerror(errno));
close(fds[1]);
- exit(1);
+ _exit(1);
} else {
/* Parent */
close(fds[1]);