From cad703672ff776b64b7729f92044a75c846171f4 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Wed, 23 Jan 2002 15:06:08 +0000 Subject: [PATCH] Appropriate error message if retrying connect failed. --- scsh/network.scm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/scsh/network.scm b/scsh/network.scm index 12fb189..97a31fe 100644 --- a/scsh/network.scm +++ b/scsh/network.scm @@ -239,17 +239,19 @@ (fdport-data:channel (fdport-data (socket:inport sock)))) (if (eq? res 0) - (handle-EINPROGRESS sock) + ;; If connect returned EINPROGRESS, we can check + ;; it's success after the next success with getsockopt + (let ((val (socket-option sock + level/socket + socket/error))) + (if (not (zero? val)) + (errno-error val + (errno-msg val) + %connect + sock + name))) (loop)))))))))))) -;;; If connect returned EINPROGRESS, we can check it's success after -;;; the next success with getsockopt - -(define (handle-EINPROGRESS sock) - (let ((val (socket-option sock level/socket socket/error))) - (if (not (zero? val)) - (errno-error val "scheme_connect" %connect)))) - (import-os-error-syscall %connect (sockfd family name) "scheme_connect") ;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-