# HG changeset patch # User Timo Sirainen # Date 1121202916 -10800 # Node ID ab0fc2c1d8e1fbc1c68cc06b9c7789853151158d # Parent 2dbd7232d7df3137cf443a5589c4618a8ff6f643 Set close-on-exec flags for opened file descriptors. diff -r 2dbd7232d7df -r ab0fc2c1d8e1 src/lib/ioloop-notify-dn.c --- a/src/lib/ioloop-notify-dn.c Tue Jul 12 23:45:59 2005 +0300 +++ b/src/lib/ioloop-notify-dn.c Wed Jul 13 00:15:16 2005 +0300 @@ -9,6 +9,7 @@ #include "ioloop-internal.h" #include "network.h" +#include "fd-close-on-exec.h" #include #include @@ -148,6 +149,9 @@ net_set_nonblock(event_pipe[0], TRUE); net_set_nonblock(event_pipe[1], TRUE); + fd_close_on_exec(event_pipe[0], TRUE); + fd_close_on_exec(event_pipe[1], TRUE); + /* SIGIO is sent if queue gets full. we'll just ignore it. */ signal(SIGIO, SIG_IGN); diff -r 2dbd7232d7df -r ab0fc2c1d8e1 src/lib/ioloop-notify-inotify.c --- a/src/lib/ioloop-notify-inotify.c Tue Jul 12 23:45:59 2005 +0300 +++ b/src/lib/ioloop-notify-inotify.c Wed Jul 13 00:15:16 2005 +0300 @@ -113,6 +113,7 @@ i_error("ioctl(INOTIFY_WATCH) failed: %m"); return NULL; } + fd_close_on_exec(watchdescriptor, TRUE); if (ctx->event_io == NULL) { ctx->event_io = io_add(ctx->inotify_fd, IO_READ, @@ -171,6 +172,7 @@ ctx->disabled = TRUE; return; } + fd_close_on_exec(ctx->inotify_fd, TRUE); ctx->buf = buffer_create_dynamic(default_pool, INITIAL_INOTIFY_BUFLEN); }