added closing descriptors in enotify module

This commit is contained in:
Roman Arutyunyan 2012-10-18 23:37:44 +04:00
parent ff1c7ecec5
commit a3fde6ea53

View file

@ -243,7 +243,7 @@ static ngx_int_t
ngx_rtmp_enotify_exec(ngx_rtmp_session_t *s, ngx_rtmp_enotify_conf_t *ec)
{
#if !(NGX_WIN32)
int pid, fd;
int pid, fd, maxfd;
ngx_str_t a, *arg;
char **args;
ngx_uint_t n;
@ -258,6 +258,13 @@ ngx_rtmp_enotify_exec(ngx_rtmp_session_t *s, ngx_rtmp_enotify_conf_t *ec)
case 0:
/* child */
/* close all descriptors */
maxfd = sysconf(_SC_OPEN_MAX);
for (fd = 0; fd < maxfd; ++fd) {
close(fd);
}
fd = open("/dev/null", O_RDWR);
dup2(fd, STDIN_FILENO);