From 6e8c2a3e46e3578b0268d422b1753995d18fb734 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 17 Jan 2012 16:35:07 -0500 Subject: Use SOCKET_OK macros in even more places Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET. Partial work for bug4533. --- src/or/buffers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/or/buffers.c') 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); -- cgit v1.2.3-54-g00ecf