1.0.3.6: Make sb-bsd-sockets use getaddrinfo/getnameinfo where available
[sbcl.git] / contrib / sb-bsd-sockets / sockets.lisp
index 829829a..072dc07 100644 (file)
@@ -5,10 +5,6 @@
 
 (eval-when (:load-toplevel :compile-toplevel :execute)
 
-#+win32
-(defvar *wsa-startup-call*
-  (sockint::wsa-startup (sockint::make-wsa-version 2 2)))
-
 (defclass socket ()
   ((file-descriptor :initarg :descriptor
                     :reader socket-file-descriptor)
@@ -24,7 +20,7 @@ protocol. Other values are used as-is.")
           :reader socket-type
           :documentation "Type of the socket: :STREAM or :DATAGRAM.")
    (stream))
-  (:documentation "Common base class of all sockets, not ment to be
+  (:documentation "Common base class of all sockets, not meant to be
 directly instantiated.")))
 
 (defmethod print-object ((object socket) stream)
@@ -100,7 +96,9 @@ values"))
                                sockaddr
                                (size-of-sockaddr socket))))
       (cond
-        ((and (= fd -1) (= sockint::EAGAIN (sb-unix::get-errno)))
+        ((and (= fd -1)
+              (member (sb-unix::get-errno)
+                      (list sockint::EAGAIN sockint::EINTR)))
          nil)
         ((= fd -1) (socket-error "accept"))
         (t (apply #'values
@@ -204,7 +202,10 @@ small"))
                                         sockaddr
                                         (sb-alien:addr sa-len))))
                 (cond
-                  ((and (= len -1) (= sockint::EAGAIN (sb-unix::get-errno))) nil)
+                  ((and (= len -1)
+                        (member (sb-unix::get-errno)
+                                (list sockint::EAGAIN sockint::EINTR)))
+                   nil)
                   ((= len -1) (socket-error "recvfrom"))
                   (t (loop for i from 0 below len
                            do (setf (elt buffer i)
@@ -280,7 +281,7 @@ send(2) will be called instead. Returns the number of octets written."))
     (cond
       ((and (= len -1)
             (member (sb-unix::get-errno)
-                    '(sockint::EAGAIN sockint::EINTR)))
+                    (list sockint::EAGAIN sockint::EINTR)))
        nil)
       ((= len -1)
        (socket-error "sendto"))