[dovecot-cvs] dovecot/src/lib ioloop-notify-dn.c, 1.5, 1.6 ioloop-notify-inotify.c, 1.3, 1.4

cras at dovecot.org cras at dovecot.org
Wed Jul 13 00:15:19 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv11838

Modified Files:
	ioloop-notify-dn.c ioloop-notify-inotify.c 
Log Message:
Set close-on-exec flags for opened file descriptors.



Index: ioloop-notify-dn.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-notify-dn.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ioloop-notify-dn.c	12 Jul 2005 15:53:55 -0000	1.5
+++ ioloop-notify-dn.c	12 Jul 2005 21:15:16 -0000	1.6
@@ -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);
 

Index: ioloop-notify-inotify.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-notify-inotify.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ioloop-notify-inotify.c	12 Jul 2005 15:54:26 -0000	1.3
+++ ioloop-notify-inotify.c	12 Jul 2005 21:15:16 -0000	1.4
@@ -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);
 }



More information about the dovecot-cvs mailing list