diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-27 17:36:07 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-27 17:36:07 +0000 |
commit | 8cae630bdc7f5d0a9919c7f1c0291ef75cb6a6cc (patch) | |
tree | 5db183ccdd3857cda5e7d8161153b0d09e6d3d1d /asterisk.c | |
parent | 7c6569f513344bcdc27de007b73fefbb62bc6cf1 (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 'asterisk.c')
-rw-r--r-- | asterisk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/asterisk.c b/asterisk.c index 9cfdc565d..bc15eb5c7 100644 --- a/asterisk.c +++ b/asterisk.c @@ -449,7 +449,7 @@ int ast_safe_system(const char *s) for (x = STDERR_FILENO + 1; x < 4096; x++) close(x); execl("/bin/sh", "/bin/sh", "-c", s, NULL); - exit(1); + _exit(1); } else if (pid > 0) { for(;;) { res = wait4(pid, &status, 0, &rusage); |