mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
* use freopen() instead close()/open() : avoid potential fd leak
This commit is contained in:
@@ -64,12 +64,9 @@ namespace i2p
|
|||||||
}
|
}
|
||||||
|
|
||||||
// close stdin/stdout/stderr descriptors
|
// close stdin/stdout/stderr descriptors
|
||||||
::close (0);
|
freopen("/dev/null", "r", stdin);
|
||||||
::open ("/dev/null", O_RDWR);
|
freopen("/dev/null", "w", stdout);
|
||||||
::close (1);
|
freopen("/dev/null", "w", stderr);
|
||||||
::open ("/dev/null", O_RDWR);
|
|
||||||
::close (2);
|
|
||||||
::open ("/dev/null", O_RDWR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pidfile
|
// Pidfile
|
||||||
|
|||||||
Reference in New Issue
Block a user