diff options
author | Andy Wingo <wingo@pobox.com> | 2016-06-02 23:12:06 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-06-09 10:59:08 +0200 |
commit | 69ea1fc45b2b06bda2e435d198e610fa9157c7ac (patch) | |
tree | 6f73028211b76b6e2e27dd64f9f253e8a0432d94 /libguile/socket.c | |
parent | e6cc051f8c3f6851be4f51ccb14109d03ae867ba (diff) | |
download | guile-69ea1fc45b2b06bda2e435d198e610fa9157c7ac.tar.gz |
Support `connect' on nonblocking sockets
* libguile/socket.c (scm_connect):
* doc/ref/posix.texi (Network Sockets and Communication): Support
connect on nonblocking ports.
Diffstat (limited to 'libguile/socket.c')
-rw-r--r-- | libguile/socket.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libguile/socket.c b/libguile/socket.c index 55b93572c..37e9f523f 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -834,7 +834,8 @@ SCM_DEFINE (scm_connect, "connect", 2, 1, 1, "Alternatively, the second argument can be a socket address object " "as returned by @code{make-socket-address}, in which case the " "no additional arguments should be passed.\n\n" - "The return value is unspecified.") + "Return true, unless the socket was configured to be non-blocking\n" + "and the operation has not finished yet.\n") #define FUNC_NAME s_scm_connect { int fd; @@ -859,10 +860,12 @@ SCM_DEFINE (scm_connect, "connect", 2, 1, 1, free (soka); errno = save_errno; + if (errno == EINPROGRESS) + return SCM_BOOL_F; SCM_SYSERROR; } free (soka); - return SCM_UNSPECIFIED; + return SCM_BOOL_T; } #undef FUNC_NAME |