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) {