]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
net_disconnect(): Ignore ECONNRESET error.
authorTimo Sirainen <tss@iki.fi>
Thu, 17 Jun 2010 13:47:16 +0000 (14:47 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 17 Jun 2010 13:47:16 +0000 (14:47 +0100)
--HG--
branch : HEAD

src/lib/network.c

index 5abc5cd83560dd11b1dcf98aa01d4adcbc802b39..af3da1e96f6d8b19e999cc4bab5c026462268e2e 100644 (file)
@@ -298,7 +298,9 @@ int net_connect_unix_with_retries(const char *path, unsigned int msecs)
 
 void net_disconnect(int fd)
 {
-       if (close(fd) < 0)
+       /* FreeBSD's close() fails with ECONNRESET if socket still has unsent
+          data in transmit buffer. We don't care. */
+       if (close(fd) < 0 && errno != ECONNRESET)
                i_error("net_disconnect() failed: %m");
 }