diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-16 22:57:54 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-16 22:57:54 +0000 |
commit | d9fc402428c10315d158f7cf960c9592276b3c82 (patch) | |
tree | 6dea5b8c8d8bb81a47195b75172db608ff217382 /main/asterisk.c | |
parent | c99aa3db824dfb5a6eddf4d7d96685e8eb1767d6 (diff) |
Standardized routines for forking processes (keeps all the specialized code in one place).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114188 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r-- | main/asterisk.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index f08a4d020..99df3ef45 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -848,9 +848,6 @@ 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; @@ -869,8 +866,7 @@ int ast_safe_system(const char *s) 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); + ast_close_fds_above_n(STDERR_FILENO); #endif execl("/bin/sh", "/bin/sh", "-c", s, (char *) NULL); _exit(1); |