chiark / gitweb /
fds: Introduce pipe_cloexec()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Sep 2014 10:41:53 +0000 (11:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Sep 2014 12:15:26 +0000 (13:15 +0100)
commit845e3f43fd5678a68d97a0919f8955af164ec69b
treed0c4a8547aa9b327c40265207bffff52ea361129
parentcab110dcaffc3e8eee681d479883e87fca80b9c3
fds: Introduce pipe_cloexec()

Replace all calls to pipe() with this new function, which checks
errors for us, and also sets both fds to close-on-exec.

There are some minor functional changes:
 * Error messages from pipe() failing are now less detailed about the
   context.  This is not important.
 * The signal self-pipe is now cloexec too.  This is at worst harmless.
 * When execing userv-ipif we rely on cloexec to close the spare
   copies of the pipe ends.
 * The stderr self-pipe spare writing end is redudantly made cloexec
   even though it is about to be closed shortly afterwards.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
process.c
secnet.c
secnet.h
slip.c
util.c