[dovecot-cvs] dovecot/src/master main.c,1.43,1.44

cras at procontrol.fi cras at procontrol.fi
Sun May 4 20:16:29 EEST 2003


Update of /home/cvs/dovecot/src/master
In directory danu:/tmp/cvs-serv32454/src/master

Modified Files:
	main.c 
Log Message:
Don't try to set /dev/null fd nonblocking, all systems don't like that.



Index: main.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/main.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- main.c	16 Apr 2003 16:05:45 -0000	1.43
+++ main.c	4 May 2003 16:16:26 -0000	1.44
@@ -264,10 +264,16 @@
 		if (*fd != -1)
 			i_fatal("Protocol %s given more than once", *proto);
 
-		*fd = port == 0 ? dup(null_fd) : net_listen(ip, &port);
-		if (*fd == -1)
-			i_fatal("listen(%d) failed: %m", port);
-		net_set_nonblock(*fd, TRUE);
+		if (port == 0) {
+			*fd = dup(null_fd);
+			if (*fd == -1)
+				i_fatal("dup(null_fd) failed: %m");
+		} else {
+			*fd = net_listen(ip, &port);
+			if (*fd == -1)
+				i_fatal("listen(%d) failed: %m", port);
+			net_set_nonblock(*fd, TRUE);
+		}
 		fd_close_on_exec(*fd, TRUE);
 	}
 




More information about the dovecot-cvs mailing list