diff options
Diffstat (limited to 'otherlibs/unix/connect.c')
-rw-r--r-- | otherlibs/unix/connect.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/otherlibs/unix/connect.c b/otherlibs/unix/connect.c index 66f20ae66..b69396b4b 100644 --- a/otherlibs/unix/connect.c +++ b/otherlibs/unix/connect.c @@ -21,9 +21,12 @@ value unix_connect(socket, address) /* ML */ value socket, address; { + int retcode; get_sockaddr(address); - if (connect(Int_val(socket), &sock_addr.s_gen, sock_addr_len) == -1) - uerror("connect", Nothing); + enter_blocking_section(); + retcode = connect(Int_val(socket), &sock_addr.s_gen, sock_addr_len); + leave_blocking_section(); + if (retcode == -1) uerror("connect", Nothing); return Val_unit; } |