mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Tor now builds on win32.
svn:r400
This commit is contained in:
@@ -66,7 +66,7 @@ poll(struct pollfd *ufds, unsigned int nfds, int timeout)
|
||||
}
|
||||
#ifdef MS_WINDOWS
|
||||
if (!any_fds_set) {
|
||||
usleep(timeout);
|
||||
Sleep(timeout);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -116,6 +116,7 @@ int spawn_func(int (*func)(void *), void *data)
|
||||
/* Child */
|
||||
func(data);
|
||||
assert(0); /* Should never reach here. */
|
||||
return 0; /* suppress "control-reaches-end-of-non-void" warning. */
|
||||
} else {
|
||||
/* Parent */
|
||||
return 0;
|
||||
@@ -236,7 +237,7 @@ tor_socketpair(int family, int type, int protocol, int fd[2])
|
||||
#ifdef MS_WINDOWS
|
||||
int correct_socket_errno(int s)
|
||||
{
|
||||
int r, optval, optvallen=sizeof(optval);
|
||||
int optval, optvallen=sizeof(optval);
|
||||
assert(errno == WSAEWOULDBLOCK);
|
||||
if (getsockopt(s, SOL_SOCKET, SO_ERROR, (void*)&optval, &optvallen))
|
||||
return errno;
|
||||
|
||||
+4
-7
@@ -19,6 +19,7 @@
|
||||
#elif defined(_MSC_VER)
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#ifndef HAVE_GETTIMEOFDAY
|
||||
#ifdef HAVE_FTIME
|
||||
#define USING_FAKE_TIMEVAL
|
||||
@@ -65,13 +66,9 @@ int tor_socketpair(int family, int type, int protocol, int fd[2]);
|
||||
* errnos which they use as the fancy strikes them.
|
||||
*/
|
||||
#ifdef MS_WINDOWS
|
||||
#define ERRNO_EAGAIN(e) ((e) == EAGAIN || \
|
||||
(e) == WSAEWOULDBLOCK || \
|
||||
(e) == EWOULDBLOCK)
|
||||
#define ERRNO_EINPROGRESS(e) ((e) == EINPROGRESS || \
|
||||
(e) == WSAEINPROGRESS)
|
||||
#define ERRNO_CONN_EINPROGRESS(e) ((e) == EINPROGRESS || \
|
||||
(e) == WSAEINPROGRESS || (e) == WSAEINVAL)
|
||||
#define ERRNO_EAGAIN(e) ((e) == EAGAIN || (e) == WSAEWOULDBLOCK)
|
||||
#define ERRNO_EINPROGRESS(e) ((e) == WSAEINPROGRESS)
|
||||
#define ERRNO_CONN_EINPROGRESS(e) ((e) == WSAEINPROGRESS || (e) == WSAEINVAL)
|
||||
int correct_socket_errno(int s);
|
||||
#else
|
||||
#define ERRNO_EAGAIN(e) ((e) == EAGAIN)
|
||||
|
||||
Reference in New Issue
Block a user