mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-20 09:51:08 +02:00
added closing descriptors in enotify module
This commit is contained in:
parent
ff1c7ecec5
commit
a3fde6ea53
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue