summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/accept.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2006-10-18 08:17:32 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2006-10-18 08:17:32 +0000
commit741d1e70781e74a523e3a142ec6176422671c8c1 (patch)
treebb654e809b7a5ab6f82a35f3f9bcc4fe3e01cf89 /otherlibs/win32unix/accept.c
parentb74f4b01e790de7c237a74ca12e2972443c81c5b (diff)
PR#4097: Tentative fix, to be tested
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7695 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/accept.c')
-rw-r--r--otherlibs/win32unix/accept.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/otherlibs/win32unix/accept.c b/otherlibs/win32unix/accept.c
index f751c3e39..0e44f5800 100644
--- a/otherlibs/win32unix/accept.c
+++ b/otherlibs/win32unix/accept.c
@@ -29,7 +29,7 @@ CAMLprim value unix_accept(sock)
int oldvalue, oldvaluelen, newvalue, retcode;
union sock_addr_union addr;
socklen_param_type addr_len;
- int errcode = 0;
+ DWORD errcode = 0;
oldvaluelen = sizeof(oldvalue);
retcode = getsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
@@ -43,9 +43,8 @@ CAMLprim value unix_accept(sock)
addr_len = sizeof(sock_addr);
enter_blocking_section();
snew = accept(sconn, &addr.s_gen, &addr_len);
+ if (snew == INVALID_SOCKET) errcode = WSAGetLastError ();
leave_blocking_section();
- if( snew == INVALID_SOCKET )
- errcode = WSAGetLastError ();
if (retcode == 0) {
/* Restore initial mode */
setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,