summaryrefslogtreecommitdiff
path: root/lib/network.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-11-08 20:46:05 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2016-11-09 13:40:05 +0100
commit2da59394ec858ae5aecf2b26ab8d9fefdae17bb8 (patch)
tree720795e72480f81c7f1cbabe1445bbd4ba8acc1c /lib/network.h
parent73ea75daa522a43ad0be9bff1f26a98bc2e105b0 (diff)
lib: add and use set_cloexec()
watchquagga is already leaking an open file descriptor on its pid file on fork+exec() invocations; next up is adding vtysh support with even more fds. Mark things CLOEXEC before going there. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/network.h')
-rw-r--r--lib/network.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/network.h b/lib/network.h
index 0fcb575d1c..a9126caf7f 100644
--- a/lib/network.h
+++ b/lib/network.h
@@ -33,6 +33,8 @@ extern int writen (int, const u_char *, int);
-1 on error. */
extern int set_nonblocking(int fd);
+extern int set_cloexec(int fd);
+
/* Does the I/O error indicate that the operation should be retried later? */
#define ERRNO_IO_RETRY(EN) \
(((EN) == EAGAIN) || ((EN) == EWOULDBLOCK) || ((EN) == EINTR))