call select in connect only on EINPROGRESS, loop on other errors

(which should not happend anyway according to POSIX).
This commit is contained in:
mainzelm 2002-10-31 09:51:48 +00:00
parent bcd64a2b3a
commit 8900f05fd2
1 changed files with 6 additions and 6 deletions

View File

@ -228,7 +228,7 @@
"connect: trying to connect socket to incompatible address ~s"
name))
((and (= family address-family/unix)
; save space for \0
; save space for \0
(> (string-length (socket-address:address name)) 107))
(error "connect: filename too long" name))
(else
@ -239,9 +239,9 @@
(socket:family sock)
(socket-address:address name))))
(if (car error?.einprogress?)
(begin
(select '#() (vector (socket:outport sock)) '#())
(if (cdr error?.einprogress?)
(if (cdr error?.einprogress?)
(begin
(select '#() (vector (socket:outport sock)) '#())
;; If connect returned EINPROGRESS, we can check
;; it's success after the next success with getsockopt
(let ((val (socket-option sock
@ -252,8 +252,8 @@
(errno-msg val)
%connect
sock
name)))
(loop))))))))))))
name))))
(loop)))))))))))
(import-os-error-syscall %connect (sockfd family name) "scheme_connect")