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

@ -239,9 +239,9 @@
(socket:family sock) (socket:family sock)
(socket-address:address name)))) (socket-address:address name))))
(if (car error?.einprogress?) (if (car error?.einprogress?)
(if (cdr error?.einprogress?)
(begin (begin
(select '#() (vector (socket:outport sock)) '#()) (select '#() (vector (socket:outport sock)) '#())
(if (cdr error?.einprogress?)
;; If connect returned EINPROGRESS, we can check ;; If connect returned EINPROGRESS, we can check
;; it's success after the next success with getsockopt ;; it's success after the next success with getsockopt
(let ((val (socket-option sock (let ((val (socket-option sock
@ -252,8 +252,8 @@
(errno-msg val) (errno-msg val)
%connect %connect
sock sock
name))) name))))
(loop)))))))))))) (loop)))))))))))
(import-os-error-syscall %connect (sockfd family name) "scheme_connect") (import-os-error-syscall %connect (sockfd family name) "scheme_connect")