Mercurial > dovecot > original-hg > dovecot-1.2
changeset 3492:ab0fc2c1d8e1 HEAD
Set close-on-exec flags for opened file descriptors.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 13 Jul 2005 00:15:16 +0300 |
parents | 2dbd7232d7df |
children | 3cc5229f1560 |
files | src/lib/ioloop-notify-dn.c src/lib/ioloop-notify-inotify.c |
diffstat | 2 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 <signal.h> #include <unistd.h> @@ -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);
--- 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); }