summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix')
-rwxr-xr-xotherlibs/win32unix/nonblock.c4
-rw-r--r--otherlibs/win32unix/select.c2
-rw-r--r--otherlibs/win32unix/unixsupport.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/otherlibs/win32unix/nonblock.c b/otherlibs/win32unix/nonblock.c
index 8df1048d5..1f2550b05 100755
--- a/otherlibs/win32unix/nonblock.c
+++ b/otherlibs/win32unix/nonblock.c
@@ -26,7 +26,7 @@ CAMLprim value unix_set_nonblock(socket)
win32_maperr(WSAGetLastError());
uerror("unix_set_nonblock", Nothing);
}
- Flags_fd_val(socket) = Flags_fd_val(socket) | FLAGS_FD_IS_BLOCKING;
+ Flags_fd_val(socket) = Flags_fd_val(socket) & ~FLAGS_FD_IS_BLOCKING;
return Val_unit;
}
@@ -39,6 +39,6 @@ CAMLprim value unix_clear_nonblock(socket)
win32_maperr(WSAGetLastError());
uerror("unix_clear_nonblock", Nothing);
}
- Flags_fd_val(socket) = Flags_fd_val(socket) & ~FLAGS_FD_IS_BLOCKING;
+ Flags_fd_val(socket) = Flags_fd_val(socket) | FLAGS_FD_IS_BLOCKING;
return Val_unit;
}
diff --git a/otherlibs/win32unix/select.c b/otherlibs/win32unix/select.c
index d96c3d9d2..af9766ff8 100644
--- a/otherlibs/win32unix/select.c
+++ b/otherlibs/win32unix/select.c
@@ -556,7 +556,7 @@ void socket_poll (HANDLE hStop, void *_data)
if (iterQuery->uFlagsFd & FLAGS_FD_IS_BLOCKING)
{
DEBUG_PRINT("Restore a blocking socket");
- iMode = 1;
+ iMode = 0;
check_error(lpSelectData,
WSAEventSelect((SOCKET)(iterQuery->hFileDescr), aEvents[i], 0) != 0 ||
ioctlsocket((SOCKET)(iterQuery->hFileDescr), FIONBIO, &iMode) != 0);
diff --git a/otherlibs/win32unix/unixsupport.c b/otherlibs/win32unix/unixsupport.c
index 2a45684a6..f6431955b 100644
--- a/otherlibs/win32unix/unixsupport.c
+++ b/otherlibs/win32unix/unixsupport.c
@@ -54,7 +54,7 @@ value win_alloc_handle(HANDLE h)
Handle_val(res) = h;
Descr_kind_val(res) = KIND_HANDLE;
CRT_fd_val(res) = NO_CRT_FD;
- Flags_fd_val(res) = 0;
+ Flags_fd_val(res) = FLAGS_FD_IS_BLOCKING;
return res;
}
@@ -64,7 +64,7 @@ value win_alloc_socket(SOCKET s)
Socket_val(res) = s;
Descr_kind_val(res) = KIND_SOCKET;
CRT_fd_val(res) = NO_CRT_FD;
- Flags_fd_val(res) = 0;
+ Flags_fd_val(res) = FLAGS_FD_IS_BLOCKING;
return res;
}