From: Rudi S. <ru...@us...> - 2007-10-08 06:19:33
|
Update of /cvsroot/sbcl/sbcl/contrib/sb-bsd-sockets In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13447/contrib/sb-bsd-sockets Modified Files: constants.lisp name-service.lisp Log Message: 1.0.10.38: fix get-host-by-address on Darwin sockaddr_in has a length field on Darwin but not on linux Index: constants.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/contrib/sb-bsd-sockets/constants.lisp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- constants.lisp 6 Mar 2007 23:26:32 -0000 1.17 +++ constants.lisp 8 Oct 2007 06:19:26 -0000 1.18 @@ -130,6 +130,7 @@ (:structure in-addr ("struct in_addr" ((array (unsigned 8)) addr "u_int32_t" "s_addr"))) (:structure sockaddr-in ("struct sockaddr_in" + #+darwin ((unsigned 8) len "__uint8_t" "sin_len") (integer family "sa_family_t" "sin_family") ;; These two could be in-port-t and ;; in-addr-t, but then we'd throw away the Index: name-service.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/contrib/sb-bsd-sockets/name-service.lisp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- name-service.lisp 8 Oct 2007 01:46:30 -0000 1.18 +++ name-service.lisp 8 Oct 2007 06:19:26 -0000 1.19 @@ -35,7 +35,7 @@ (#.sockint::af-inet ;; CLH: Work around x86-64 darwin bug here. ;; The length is reported as 8, when it should be 4. - ;; FIXME: this is rumored to be fix in 10.5 + ;; FIXME: this is rumored to be fixed in 10.5 #+(and darwin x86-64) (progn (assert (or (= length 4) (= length 8))) @@ -125,6 +125,7 @@ (assert (= (length address) 4)) (sockint::with-sockaddr-in sockaddr () (sb-alien:with-alien ((host-buf (array char #.ni-max-host))) + #+darwin (setf (sockint::sockaddr-in-len sockaddr) 16) (setf (sockint::sockaddr-in-family sockaddr) sockint::af-inet) (dotimes (i 4) (setf (sb-alien:deref (sockint::sockaddr-in-addr sockaddr) i) |