[slime-cvs] CVS update: slime/swank-cmucl.lisp

Helmut Eller heller at common-lisp.net
Thu Jan 13 23:17:04 UTC 2005


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv31508

Modified Files:
	swank-cmucl.lisp 
Log Message:
(create-socket): The byte-order of the :host argument for
CREATE-INET-LISTENER was changed in the Jan 2005 snapshot.  Test
whether the symbol 'ext:socket-error exists to decide if we are in a
older version.  
(resolve-hostname): Return the address in host byte-order.

Date: Fri Jan 14 00:17:03 2005
Author: heller

Index: slime/swank-cmucl.lisp
diff -u slime/swank-cmucl.lisp:1.135 slime/swank-cmucl.lisp:1.136
--- slime/swank-cmucl.lisp:1.135	Thu Dec 16 22:14:42 2004
+++ slime/swank-cmucl.lisp	Fri Jan 14 00:17:02 2005
@@ -78,9 +78,11 @@
 
 #-(or ppc mips)
 (defimplementation create-socket (host port)
-  (ext:create-inet-listener port :stream
-                            :reuse-address t 
-                            :host (resolve-hostname host)))
+  (let* ((addr (resolve-hostname host))
+         (addr (if (not (find-symbol "SOCKET-ERROR" :ext))
+                   (ext:htonl addr)
+                   addr)))
+    (ext:create-inet-listener port :stream :reuse-address t :host addr)))
 
 ;; There seems to be a bug in create-inet-listener on Mac/OSX and Irix.
 #+(or ppc mips)
@@ -109,10 +111,9 @@
     (sys:fd-stream (sys:fd-stream-fd socket))))
 
 (defun resolve-hostname (hostname)
-  "Return the IP address of HOSTNAME as an integer."
-  (let* ((hostent (ext:lookup-host-entry hostname))
-         (address (car (ext:host-entry-addr-list hostent))))
-    (ext:htonl address)))
+  "Return the IP address of HOSTNAME as an integer (in host byte-order)."
+  (let ((hostent (ext:lookup-host-entry hostname)))
+    (car (ext:host-entry-addr-list hostent))))
 
 (defun make-socket-io-stream (fd)
   "Create a new input/output fd-stream for FD."




More information about the slime-cvs mailing list