changeset 2944:f66a150d3fb9

* process.c (Fopen_network_stream): Deal with older systems, which only have the h_addr field in their struct hostent.
author Jim Blandy <jimb@redhat.com>
date Sat, 22 May 1993 00:12:17 +0000
parents be86b41a0661
children 2c1f0215fcc3
files src/process.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Fri May 21 23:47:10 1993 +0000
+++ b/src/process.c	Sat May 22 00:12:17 1993 +0000
@@ -1448,8 +1448,13 @@
       host_info.h_name = 0;
       host_info.h_aliases = 0;
       host_info.h_addrtype = AF_INET;
-      host_info.h_addr_list  =  &(addr_list[0]);
-      addr_list[0] = (char*)(&numeric_addr);
+#ifdef h_addr
+      /* Older machines have only one address slot called h_addr.
+	 Newer machines have h_addr_list, but #define h_addr to
+	 be its first element.  */
+      host_info.h_addr_list = &(addr_list[0]);
+#endif
+      host_info.h_addr = (char*)(&numeric_addr);
       addr_list[1] = 0;
       host_info.h_length = strlen (addr_list[0]);
     }