git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45595
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
int ast_safe_system(const char *s)
{
pid_t pid;
+#ifdef HAVE_WORKING_FORK
int x;
+#endif
int res;
struct rusage rusage;
int status;
#endif
if (pid == 0) {
+#ifdef HAVE_WORKING_FORK
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);
+#endif
execl("/bin/sh", "/bin/sh", "-c", s, (char *) NULL);
exit(1);
} else if (pid > 0) {