Mercurial > dovecot > core-2.2
changeset 17120:93cf0434dda4
net_transmit() may have wrongly returned EPIPE error.
If errno was EPIPE before net_transmit() was called and sendto() didn't
change it, we still returned error.
Also removed the unlikely() call which isn't all that unlikely for
non-blocking code.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 30 Jan 2014 22:03:40 +0100 |
parents | d9d2d04bb320 |
children | 5432b55a2b87 |
files | src/lib/net.c |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/net.c Thu Jan 30 03:38:57 2014 +0100 +++ b/src/lib/net.c Thu Jan 30 22:03:40 2014 +0100 @@ -605,12 +605,12 @@ i_assert(len <= SSIZE_T_MAX); ret = send(fd, data, len, 0); - if (unlikely(ret == -1 && (errno == EINTR || errno == EAGAIN))) - return 0; - - if (unlikely(errno == EPIPE)) - return -2; - + if (ret == -1) { + if (errno == EINTR || errno == EAGAIN) + return 0; + if (errno == EPIPE) + return -2; + } return ret; }