changeset 4998:3cd3a39f98f4

(IN_ADDR, NUMERIC_ADDR_ERROR): New macros (two versions). (Fopen_network_stream): Use them.
author Richard M. Stallman <rms@gnu.org>
date Sat, 13 Nov 1993 09:31:34 +0000
parents 96c0a97da147
children 17ff41a8348d
files src/process.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Sat Nov 13 08:21:16 1993 +0000
+++ b/src/process.c	Sat Nov 13 09:31:34 1993 +0000
@@ -51,6 +51,15 @@
 #include <client.h>
 #endif
 
+/* DGUX inet_addr returns a 'struct in_addr'. */
+#ifdef DGUX
+#define IN_ADDR struct in_addr
+#define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
+#else
+#define IN_ADDR unsigned long
+#define NUMERIC_ADDR_ERROR (numeric_addr == -1)
+#endif
+
 #if defined(BSD) || defined(STRIDE)
 #include <sys/ioctl.h>
 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
@@ -1380,7 +1389,7 @@
   struct servent *svc_info;
   struct hostent *host_info_ptr, host_info;
   char *(addr_list[2]);
-  unsigned long numeric_addr;
+  IN_ADDR numeric_addr;
   int s, outch, inch;
   char errstring[80];
   int port;
@@ -1407,7 +1416,7 @@
     /* Attempt to interpret host as numeric inet address */
     {
       numeric_addr = inet_addr ((char *) XSTRING (host)->data);
-      if (numeric_addr == -1)
+      if (NUMERIC_ADDR_ERROR)
 	error ("Unknown host \"%s\"", XSTRING (host)->data);
 
       host_info_ptr = &host_info;