[prev in list] [next in list] [prev in thread] [next in thread]
List: dovecot-cvs
Subject: dovecot-2.2: net_transmit() may have wrongly returned EPIPE error.
From: dovecot () dovecot ! org (dovecot at dovecot ! org)
Date: 2014-01-30 21:04:46
Message-ID: hg.93cf0434dda4.1391115886.6920021320469856403 () localhost ! localdomain
[Download RAW message or body]
details: http://hg.dovecot.org/dovecot-2.2/rev/93cf0434dda4
changeset: 17120:93cf0434dda4
user: Timo Sirainen <tss at iki.fi>
date: Thu Jan 30 22:03:40 2014 +0100
description:
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.
diffstat:
src/lib/net.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (22 lines):
diff -r d9d2d04bb320 -r 93cf0434dda4 src/lib/net.c
--- 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;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic