diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-27 17:39:31 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-27 17:39:31 +0000 |
commit | 83e66fa60070ea934061f173f1db6d95e461a124 (patch) | |
tree | fc7fdf041e5accbca6bc15a56bd5aa9ce6b9a402 /res | |
parent | 5cf507d56d6089e6b63eb0780089e797ccff008e (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.4@46363 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 4 | ||||
-rw-r--r-- | res/res_musiconhold.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index de9fd3151..7a9677c6c 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -318,7 +318,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 */ @@ -330,7 +330,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 a4debac8f..d6832009d 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]); |