aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorRichard M. Stallman1993-11-13 09:31:34 +0000
committerRichard M. Stallman1993-11-13 09:31:34 +0000
commit79967d5e93a1d4c048305539bd98f2dcb9f43529 (patch)
treeb4bd753714eb43ecb2ea12f120b7c2e7dacdc3b2 /src/process.c
parent54d4b6096c15c812b60cc4860f149e93c7f4bc7d (diff)
downloademacs-79967d5e93a1d4c048305539bd98f2dcb9f43529.tar.gz
emacs-79967d5e93a1d4c048305539bd98f2dcb9f43529.zip
(IN_ADDR, NUMERIC_ADDR_ERROR): New macros (two versions).
(Fopen_network_stream): Use them.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index 0046947f6e3..0daa81fa210 100644
--- a/src/process.c
+++ b/src/process.c
@@ -51,6 +51,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
51#include <client.h> 51#include <client.h>
52#endif 52#endif
53 53
54/* DGUX inet_addr returns a 'struct in_addr'. */
55#ifdef DGUX
56#define IN_ADDR struct in_addr
57#define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
58#else
59#define IN_ADDR unsigned long
60#define NUMERIC_ADDR_ERROR (numeric_addr == -1)
61#endif
62
54#if defined(BSD) || defined(STRIDE) 63#if defined(BSD) || defined(STRIDE)
55#include <sys/ioctl.h> 64#include <sys/ioctl.h>
56#if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) 65#if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
@@ -1380,7 +1389,7 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
1380 struct servent *svc_info; 1389 struct servent *svc_info;
1381 struct hostent *host_info_ptr, host_info; 1390 struct hostent *host_info_ptr, host_info;
1382 char *(addr_list[2]); 1391 char *(addr_list[2]);
1383 unsigned long numeric_addr; 1392 IN_ADDR numeric_addr;
1384 int s, outch, inch; 1393 int s, outch, inch;
1385 char errstring[80]; 1394 char errstring[80];
1386 int port; 1395 int port;
@@ -1407,7 +1416,7 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
1407 /* Attempt to interpret host as numeric inet address */ 1416 /* Attempt to interpret host as numeric inet address */
1408 { 1417 {
1409 numeric_addr = inet_addr ((char *) XSTRING (host)->data); 1418 numeric_addr = inet_addr ((char *) XSTRING (host)->data);
1410 if (numeric_addr == -1) 1419 if (NUMERIC_ADDR_ERROR)
1411 error ("Unknown host \"%s\"", XSTRING (host)->data); 1420 error ("Unknown host \"%s\"", XSTRING (host)->data);
1412 1421
1413 host_info_ptr = &host_info; 1422 host_info_ptr = &host_info;