From cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 23 May 2011 00:17:48 -0400 Subject: Use a 64-bit type to hold sockets on win64. On win64, sockets are of type UINT_PTR; on win32 they're u_int; elsewhere they're int. The correct windows way to check a socket for being set is to compare it with INVALID_SOCKET; elsewhere you see if it is negative. On Libevent 2, all callbacks take sockets as evutil_socket_t; we've been passing them int. This patch should fix compilation and correctness when built for 64-bit windows. Fixes bug 3270. --- src/common/util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/util.h') diff --git a/src/common/util.h b/src/common/util.h index f32709accd..ebbcf78bdc 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -276,8 +276,8 @@ typedef struct ratelim_t { char *rate_limit_log(ratelim_t *lim, time_t now); /* File helpers */ -ssize_t write_all(int fd, const char *buf, size_t count, int isSocket); -ssize_t read_all(int fd, char *buf, size_t count, int isSocket); +ssize_t write_all(tor_socket_t fd, const char *buf, size_t count, int isSocket); +ssize_t read_all(tor_socket_t fd, char *buf, size_t count, int isSocket); /** Return values from file_status(); see that function's documentation * for details. */ -- cgit v1.2.3-54-g00ecf