diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-23 00:17:48 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-23 00:17:48 -0400 |
commit | cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd (patch) | |
tree | f720f8ec3f8dcc065ea47b2c10c1e2885403e082 /src/or/cpuworker.c | |
parent | 1ba1bdee4bd8f3c00e603fe9b0fd2f14eeb60466 (diff) | |
download | tor-cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd.tar.gz tor-cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd.zip |
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.
Diffstat (limited to 'src/or/cpuworker.c')
-rw-r--r-- | src/or/cpuworker.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 7cbc191333..c5e4863f7f 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -226,8 +226,8 @@ cpuworker_main(void *data) { char question[ONIONSKIN_CHALLENGE_LEN]; uint8_t question_type; - int *fdarray = data; - int fd; + tor_socket_t *fdarray = data; + tor_socket_t fd; /* variables for onion processing */ char keys[CPATH_KEY_MATERIAL_LEN]; @@ -317,12 +317,12 @@ cpuworker_main(void *data) static int spawn_cpuworker(void) { - int *fdarray; - int fd; + tor_socket_t *fdarray; + tor_socket_t fd; connection_t *conn; int err; - fdarray = tor_malloc(sizeof(int)*2); + fdarray = tor_malloc(sizeof(tor_socket_t)*2); if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray)) < 0) { log_warn(LD_NET, "Couldn't construct socketpair for cpuworker: %s", tor_socket_strerror(-err)); |