diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-11-28 05:48:02 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-11-28 05:48:02 +0000 |
commit | f77ff938b7774d45f106b0fa9d6b6a8bab176b72 (patch) | |
tree | e19b4d1ea291556c8e0d5e826b338df52f42d330 /src/or/buffers.c | |
parent | 9449ff73368974db10ae05c64b13a9ff0a02f25f (diff) | |
download | tor-f77ff938b7774d45f106b0fa9d6b6a8bab176b72.tar.gz tor-f77ff938b7774d45f106b0fa9d6b6a8bab176b72.zip |
remember; tor_socket_errno has side effects!
svn:r2997
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 6 |
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."); |