changeset 44314:f76a1425eb34

(DATAGRAM_CONN_P, list_processes_1) (Fprocess_datagram_address, Fset_process_datagram_address) (Fset_network_process_options, server_accept_connection): Fix some int/Lisp_Object confusions (thank you union types).
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 01 Apr 2002 19:49:47 +0000
parents d50a0256aa1b
children 61313ed69c33
files src/process.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Mon Apr 01 19:49:39 2002 +0000
+++ b/src/process.c	Mon Apr 01 19:49:47 2002 +0000
@@ -307,7 +307,7 @@
   int len;
 } datagram_address[MAXDESC];
 #define DATAGRAM_CHAN_P(chan)	(datagram_address[chan].sa != 0)
-#define DATAGRAM_CONN_P(proc)	(PROCESSP (proc) && datagram_address[XPROCESS (proc)->infd].sa != 0)
+#define DATAGRAM_CONN_P(proc)	(PROCESSP (proc) && datagram_address[XINT (XPROCESS (proc)->infd)].sa != 0)
 #else
 #define DATAGRAM_CHAN_P(chan)	(0)
 #define DATAGRAM_CONN_P(proc)	(0)
@@ -1200,7 +1200,7 @@
 	  if (INTEGERP (port))
 	    port = Fnumber_to_string (port);
 	  sprintf (tembuf, "(network %s server on %s)\n",
-		   (DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
+		   (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"),
 		   XSTRING (port)->data);
 	  insert_string (tembuf);
 	}
@@ -1216,7 +1216,7 @@
 		host = Fnumber_to_string (host);
 	    }
 	  sprintf (tembuf, "(network %s connection to %s)\n",
-		   (DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
+		   (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"),
 		   XSTRING (host)->data);
 	  insert_string (tembuf);
         }
@@ -2119,7 +2119,7 @@
   if (!DATAGRAM_CONN_P (process))
     return Qnil;
 
-  channel = XPROCESS (process)->infd;
+  channel = XINT (XPROCESS (process)->infd);
   return conv_sockaddr_to_lisp (datagram_address[channel].sa,
 				datagram_address[channel].len);
 }
@@ -2139,7 +2139,7 @@
   if (!DATAGRAM_CONN_P (process))
     return Qnil;
 
-  channel = XPROCESS (process)->infd;
+  channel = XINT (XPROCESS (process)->infd);
 
   len = get_lisp_to_sockaddr_size (address, &family);
   if (datagram_address[channel].len != len)
@@ -2374,10 +2374,10 @@
 
   process = args[0];
   CHECK_PROCESS (process);
-  if (nargs > 1 && XPROCESS (process)->infd >= 0)
+  if (nargs > 1 && XINT (XPROCESS (process)->infd) >= 0)
     {
       opts = Flist (nargs, args);
-      set_socket_options (XPROCESS (process)->infd, opts, 0);
+      set_socket_options (XINT (XPROCESS (process)->infd), opts, 0);
     }
   return process;
 }
@@ -3528,7 +3528,7 @@
 		      (STRINGP (host) ? host : build_string ("-")),
 		      build_string ("\n")));
 
-  if (p->sentinel)
+  if (!NILP (p->sentinel))
     exec_sentinel (proc, 
 		   concat3 (build_string ("open from "),
 			    (STRINGP (host) ? host : build_string ("-")),