diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-01-17 16:35:07 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-01-17 16:35:07 -0500 |
commit | 6e8c2a3e46e3578b0268d422b1753995d18fb734 (patch) | |
tree | 0f2952090d871b437021d2f6c6059e78234fa0f5 /src/or/buffers.c | |
parent | 1e923dd2fbdc0834b8fb3ba97b658f15a6d5f6b4 (diff) | |
download | tor-6e8c2a3e46e3578b0268d422b1753995d18fb734.tar.gz tor-6e8c2a3e46e3578b0268d422b1753995d18fb734.zip |
Use SOCKET_OK macros in even more places
Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET.
Partial work for bug4533.
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 7c49423e16..dbecf125c9 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -690,7 +690,7 @@ read_to_buf(tor_socket_t s, size_t at_most, buf_t *buf, int *reached_eof, check(); tor_assert(reached_eof); - tor_assert(s >= 0); + tor_assert(SOCKET_OK(s)); while (at_most > total_read) { size_t readlen = at_most - total_read; @@ -858,7 +858,7 @@ flush_buf(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen) int r; size_t flushed = 0; tor_assert(buf_flushlen); - tor_assert(s >= 0); + tor_assert(SOCKET_OK(s)); tor_assert(*buf_flushlen <= buf->datalen); tor_assert(sz <= *buf_flushlen); |