mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-17 21:26:04 +00:00
* use freopen() instead close()/open() : avoid potential fd leak
This commit is contained in:
parent
2e848a7c9a
commit
7bbe926232
@ -64,12 +64,9 @@ namespace i2p
|
||||
}
|
||||
|
||||
// close stdin/stdout/stderr descriptors
|
||||
::close (0);
|
||||
::open ("/dev/null", O_RDWR);
|
||||
::close (1);
|
||||
::open ("/dev/null", O_RDWR);
|
||||
::close (2);
|
||||
::open ("/dev/null", O_RDWR);
|
||||
freopen("/dev/null", "r", stdin);
|
||||
freopen("/dev/null", "w", stdout);
|
||||
freopen("/dev/null", "w", stderr);
|
||||
}
|
||||
|
||||
// Pidfile
|
||||
|
Loading…
Reference in New Issue
Block a user