aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-27 17:36:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-27 17:36:07 +0000
commit8cae630bdc7f5d0a9919c7f1c0291ef75cb6a6cc (patch)
tree5db183ccdd3857cda5e7d8161153b0d09e6d3d1d /res/res_agi.c
parent7c6569f513344bcdc27de007b73fefbb62bc6cf1 (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.2@46361 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index de4c7be39..56ab7bf42 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -297,7 +297,7 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op
/* 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 */
@@ -308,7 +308,7 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op
execv(script, argv);
/* Can't use ast_log since FD's are closed */
fprintf(stderr, "Failed to execute '%s': %s\n", script, strerror(errno));
- exit(1);
+ _exit(1);
}
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Launched AGI Script %s\n", script);