From 8900f05fd201630fade1915aa0401201877d97c1 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Thu, 31 Oct 2002 09:51:48 +0000 Subject: [PATCH] call select in connect only on EINPROGRESS, loop on other errors (which should not happend anyway according to POSIX). --- scsh/network.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scsh/network.scm b/scsh/network.scm index 4b9ffb3..3b7dd35 100644 --- a/scsh/network.scm +++ b/scsh/network.scm @@ -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")