mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Standardized routines for forking processes (keeps all the specialized code in one place).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user