summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-09-05 14:14:32 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-09-05 14:14:32 +0000
commit1f872c8094ff0e34fa7ea404995fc51ba9995674 (patch)
tree1c947673a0851b6a58702e86d78417ca4662d32a /src
parent91ecef39cad37bb5de008f557bded8dcbc8aa6e3 (diff)
Ignore EPIPE as well as ECONNECT when closing down an SMTP session in
the daemon, since dropped connections can show as EPIPE in Solaris.
Diffstat (limited to 'src')
-rw-r--r--src/src/daemon.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/src/daemon.c b/src/src/daemon.c
index f1912c40f..1311d711c 100644
--- a/src/src/daemon.c
+++ b/src/src/daemon.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/daemon.c,v 1.15 2006/02/22 14:46:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/daemon.c,v 1.16 2006/09/05 14:14:32 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -680,13 +680,14 @@ ERROR_RETURN:
/* Close the streams associated with the socket which will also close the
socket fds in this process. We can't do anything if fclose() fails, but
logging brings it to someone's attention. However, "connection reset by peer"
-isn't really a problem, so skip that one. If the streams don't exist, something
-went wrong while setting things up. Make sure the socket descriptors are
-closed, in order to drop the connection. */
+isn't really a problem, so skip that one. On Solaris, a dropped connection can
+manifest itself as a broken pipe, so drop that one too. If the streams don't
+exist, something went wrong while setting things up. Make sure the socket
+descriptors are closed, in order to drop the connection. */
if (smtp_out != NULL)
{
- if (fclose(smtp_out) != 0 && errno != ECONNRESET)
+ if (fclose(smtp_out) != 0 && errno != ECONNRESET && errno != EPIPE)
log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_out) failed: %s",
strerror(errno));
smtp_out = NULL;
@@ -695,7 +696,7 @@ else (void)close(accept_socket);
if (smtp_in != NULL)
{
- if (fclose(smtp_in) != 0 && errno != ECONNRESET)
+ if (fclose(smtp_in) != 0 && errno != ECONNRESET && errno != EPIPE)
log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_in) failed: %s",
strerror(errno));
smtp_in = NULL;