summaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 47b82fed40..99b8779f28 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -184,7 +184,8 @@ int read_to_buf(int s, size_t at_most, buf_t *buf, int *reached_eof) {
// log_fn(LOG_DEBUG,"reading at most %d bytes.",at_most);
read_result = recv(s, buf->mem+buf->datalen, at_most, 0);
if (read_result < 0) {
- if(!ERRNO_IS_EAGAIN(tor_socket_errno(s))) { /* it's a real error */
+ int e = tor_socket_errno(s);
+ if(!ERRNO_IS_EAGAIN(e)) { /* it's a real error */
return -1;
}
return 0; /* would block. */
@@ -254,7 +255,8 @@ int flush_buf(int s, buf_t *buf, size_t *buf_flushlen)
write_result = send(s, buf->mem, *buf_flushlen, 0);
if (write_result < 0) {
- if(!ERRNO_IS_EAGAIN(tor_socket_errno(s))) { /* it's a real error */
+ int e = tor_socket_errno(s);
+ if(!ERRNO_IS_EAGAIN(e)) { /* it's a real error */
return -1;
}
log_fn(LOG_DEBUG,"write() would block, returning.");