[usocket-cvs] r286 - usocket/trunk/backend

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Tue Sep 4 22:52:04 UTC 2007


Author: ehuelsmann
Date: Tue Sep  4 18:52:04 2007
New Revision: 286

Modified:
   usocket/trunk/backend/sbcl.lisp
Log:
Fix sbcl/ecl problems pointed out by Yaroslav Kavenchuk <kavenchuk at gmail.com>.

Modified: usocket/trunk/backend/sbcl.lisp
==============================================================================
--- usocket/trunk/backend/sbcl.lisp	(original)
+++ usocket/trunk/backend/sbcl.lisp	Tue Sep  4 18:52:04 2007
@@ -32,7 +32,7 @@
                       (sb-alien:cast buf (* sb-alien:char))
                       256)))
          (when (= result 0)
-           (cast buf sb-alien:c-string))))))
+           (sb-alien:cast buf sb-alien:c-string))))))
 
 
 #+ecl
@@ -48,8 +48,7 @@
    "#include <winsock2.h>")
 
   (ffi:clines
-   "#include <ecl/ecl-inl.h>"
-   "#include <string.h>")
+   "#include <ecl/ecl-inl.h>")
 
   #+:prefixed-api
   (ffi:clines
@@ -67,13 +66,12 @@
   (defun get-host-name ()
     (ffi:c-inline
      () () :object
-     "{ char buf[256];
-        int r = gethostname(&buf,256);
+     "{ char *buf = GC_malloc(256);
 
-        if (r == 0)
-           @(return) = make_simple_base_string(strndup(&buf,255));
+        if (gethostname(buf,256) == 0)
+          @(return) = make_simple_base_string(buf);
         else
-           @(return) = Cnil;
+          @(return) = Cnil;
       }" :one-liner nil :side-effects nil))
 
   (defun read-select (read-fds to-secs &optional (to-musecs 0))



More information about the usocket-cvs mailing list