summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/bind.c')
-rw-r--r--otherlibs/win32unix/bind.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/otherlibs/win32unix/bind.c b/otherlibs/win32unix/bind.c
index e85a5c312..5af7da326 100644
--- a/otherlibs/win32unix/bind.c
+++ b/otherlibs/win32unix/bind.c
@@ -20,7 +20,10 @@ value unix_bind(socket, address) /* ML */
{
int ret;
get_sockaddr(address);
- ret = bind(_get_osfhandle(Int_val(socket)), &sock_addr.s_gen, sock_addr_len);
- if (ret == -1) uerror("bind", Nothing);
+ ret = bind((SOCKET) Handle_val(socket), &sock_addr.s_gen, sock_addr_len);
+ if (ret == -1) {
+ _dosmaperr(WSAGetLastError());
+ uerror("bind", Nothing);
+ }
return Val_unit;
}