[dovecot-cvs] dovecot/src/lib network.c,1.31,1.32

cras at dovecot.org cras at dovecot.org
Thu Aug 18 20:27:06 EEST 2005


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

Modified Files:
	network.c 
Log Message:
Don't log extra bind() errors for net_listen_unix() either



Index: network.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/network.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- network.c	14 Aug 2005 23:19:29 -0000	1.31
+++ network.c	18 Aug 2005 17:27:04 -0000	1.32
@@ -340,12 +340,16 @@
 	}
 
 	/* bind */
-	if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0)
-		i_error("bind(%s) failed: %m", path);
-	else {
+	if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
+		if (errno != EADDRINUSE)
+			i_error("bind(%s) failed: %m", path);
+	} else {
 		/* start listening */
 		if (listen(fd, backlog) == 0)
 			return fd;
+
+		if (errno != EADDRINUSE)
+			i_error("listen() failed: %m");
 	}
 
 	close_save_errno(fd);



More information about the dovecot-cvs mailing list