This happens e.g. on FreeBSD when closing a socket that has not been
fully flushed to client. Since we can't do anything about that,
we might as well just ignore it.
}
saved_errno = errno;
- if (unlikely(close(*fd) < 0))
+ /* Ignore ECONNRESET because we don't really care about it here,
+ as we are closing the socket down in any case. There might be
+ unsent data but nothing we can do about that. */
+ if (unlikely(close(*fd) < 0 && errno != ECONNRESET))
i_error("%s: close(%s%s%s) @ %s:%d failed (fd=%d): %m",
func, arg,
(path == NULL) ? "" : " = ",