[dovecot-cvs] dovecot/src/master main.c,1.91,1.92

cras at dovecot.org cras at dovecot.org
Thu Aug 17 21:17:41 EEST 2006


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

Modified Files:
	main.c 
Log Message:
Cleanup + handle dup() failure.



Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/main.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- main.c	10 Aug 2006 18:46:58 -0000	1.91
+++ main.c	17 Aug 2006 18:17:38 -0000	1.92
@@ -426,8 +426,8 @@
 			if (*fd == -1)
 				i_fatal("listen(%d) failed: %m", port);
 			net_set_nonblock(*fd, TRUE);
+			fd_close_on_exec(*fd, TRUE);
 		}
-		fd_close_on_exec(*fd, TRUE);
 	}
 
 	if (set->listen_fd == -1)
@@ -508,6 +508,8 @@
 	/* make sure all fds between 0..3 are used. */
 	while (null_fd < 4) {
 		null_fd = dup(null_fd);
+		if (null_fd == -1)
+			i_fatal("dup(null_fd) failed: %m");
 		fd_close_on_exec(null_fd, TRUE);
 	}
 



More information about the dovecot-cvs mailing list