Diff of /contrib/sockets/sockets.lisp [237af2] .. [50ba00] Maximize Restore

  Switch to side-by-side view

--- a/contrib/sockets/sockets.lisp
+++ b/contrib/sockets/sockets.lisp
@@ -517,9 +517,15 @@
 (defun get-protocol-by-name (string-or-symbol)
   "Calls getprotobyname"
   (let ((string (string string-or-symbol)))
-    (c-inline (string) (:cstring) :int
-	      "getprotobyname(#0)->p_proto"
-	      :one-liner t)))
+      (c-inline (string) (:cstring) :int
+                "{
+                 struct protoent *pe;
+
+                 pe = getprotobyname(#0);
+                 @(return 0) = pe ? pe->p_proto : -1;
+                 }
+               ")))
+
 
 (defun make-inet-address (dotted-quads)
   "Return a vector of octets given a string DOTTED-QUADS in the format