It's safer to close stdin/out/err by replacing their fd with /dev/null.
Otherwise the next opened fds are 0/1/2, and any code writing to
stdout/stderr might break things by writing to an unintentional fd.
Signed-off-by:
Timo Sirainen <tss@iki.fi>
parent
b245ed00
Please register or sign in to comment