mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-06-09 00:42:51 -04:00
Merge 7d0ac0376e into 2b8afc6c68
This commit is contained in:
commit
07900b0a21
1 changed files with 15 additions and 0 deletions
|
|
@ -261,6 +261,21 @@ close_fds_except(int keep)
|
|||
close(i);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(HAVE_DUP) && defined(HAVE_DUP2)
|
||||
int fd;
|
||||
if ((fd = open ("/dev/null", O_RDWR, 0)) != -1)
|
||||
{
|
||||
dup2 (fd, 0);
|
||||
dup2 (fd, 1);
|
||||
dup2 (fd, 2);
|
||||
if (fd > 2)
|
||||
{
|
||||
close (fd);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue