summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index fd70242e9e..beb9545af1 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1828,8 +1828,17 @@ myselect (int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
if (!NtSocketsInitialized++) {
StartSockets();
}
- if ((r = select (nfds, rd, wr, ex, timeout)) == SOCKET_ERROR)
+ if ((r = select (nfds, rd, wr, ex, timeout)) == SOCKET_ERROR) {
errno = WSAGetLastError();
+ switch (errno) {
+ case WSAEINTR:
+ errno = EINTR;
+ break;
+ case WSAENOTSOCK:
+ errno = EBADF;
+ break;
+ }
+ }
return r;
}