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") ;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-