From 8b386a63b1e6c4d2879202ab00b08b9bd6e82701 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 1 Jul 2010 04:00:41 +0000 Subject: [PATCH] (trunk libT) #3311 "MingW build of Transmission" -- added rb07's revisions to my revisions to his diff. :P --- libtransmission/net.c | 2 +- libtransmission/web.c | 1 + third-party/dht/dht.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libtransmission/net.c b/libtransmission/net.c index d28e96cd5..c7ae2d659 100644 --- a/libtransmission/net.c +++ b/libtransmission/net.c @@ -152,7 +152,7 @@ tr_net_strerror( char * buf, size_t buflen, int err ) { *buf = '\0'; #ifdef WIN32 - FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, NULL, e, 0, buf, buflen, NULL ); + FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, buf, buflen, NULL ); #else tr_strlcpy( buf, tr_strerror( err ), buflen ); #endif diff --git a/libtransmission/web.c b/libtransmission/web.c index e9a72fe79..2888c9a72 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -256,6 +256,7 @@ tr_select( int nfds, #ifdef WIN32 if( !r_fd_set->fd_count && !w_fd_set->fd_count && !c_fd_set->fd_count ) { + const long int msec = t->tv_sec*1000 + t->tv_usec/1000; tr_wait_msec( msec ); } else if( select( 0, r_fd_set->fd_count ? r_fd_set : NULL, diff --git a/third-party/dht/dht.c b/third-party/dht/dht.c index 7f511c7d4..bd554b14f 100644 --- a/third-party/dht/dht.c +++ b/third-party/dht/dht.c @@ -66,6 +66,7 @@ THE SOFTWARE. #ifdef WIN32 #define EAFNOSUPPORT WSAEAFNOSUPPORT +#define EAGAIN WSAEWOULDBLOCK static int set_nonblocking(int fd, int nonblocking) {