summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/connect.c')
-rw-r--r--otherlibs/win32unix/connect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/otherlibs/win32unix/connect.c b/otherlibs/win32unix/connect.c
index 24380582b..dabcc4e84 100644
--- a/otherlibs/win32unix/connect.c
+++ b/otherlibs/win32unix/connect.c
@@ -21,10 +21,12 @@ value unix_connect(socket, address) /* ML */
{
SOCKET s = (SOCKET) Handle_val(socket);
int retcode;
+ union sock_addr_union addr;
+ socklen_param_type addr_len;
- get_sockaddr(address);
+ get_sockaddr(address, &addr, &addr_len);
enter_blocking_section();
- retcode = connect(s, &sock_addr.s_gen, sock_addr_len);
+ retcode = connect(s, &addr.s_gen, addr_len);
leave_blocking_section();
if (retcode == -1) unix_error(WSAGetLastError(), "connect", Nothing);
return Val_unit;