comparison src/process.c @ 4914:56bc426b1eb4

[TERM]: Include client.h. (Fopen_network_stream): Handle TERM.
author Richard M. Stallman <rms@gnu.org>
date Thu, 04 Nov 1993 22:13:15 +0000
parents a806d71f58f6
children 4146a65b9f02
comparison
equal deleted inserted replaced
4913:eb26686b99cf 4914:56bc426b1eb4
43 #include <sys/socket.h> 43 #include <sys/socket.h>
44 #include <netdb.h> 44 #include <netdb.h>
45 #include <netinet/in.h> 45 #include <netinet/in.h>
46 #include <arpa/inet.h> 46 #include <arpa/inet.h>
47 #endif /* HAVE_SOCKETS */ 47 #endif /* HAVE_SOCKETS */
48
49 /* TERM is a poor-man's SLIP, used on Linux. */
50 #ifdef TERM
51 #include <client.h>
52 #endif
48 53
49 #if defined(BSD) || defined(STRIDE) 54 #if defined(BSD) || defined(STRIDE)
50 #include <sys/ioctl.h> 55 #include <sys/ioctl.h>
51 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) 56 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
52 #include <fcntl.h> 57 #include <fcntl.h>
1394 if (svc_info == 0) 1399 if (svc_info == 0)
1395 error ("Unknown service \"%s\"", XSTRING (service)->data); 1400 error ("Unknown service \"%s\"", XSTRING (service)->data);
1396 port = svc_info->s_port; 1401 port = svc_info->s_port;
1397 } 1402 }
1398 1403
1404 #ifndef TERM
1399 host_info_ptr = gethostbyname (XSTRING (host)->data); 1405 host_info_ptr = gethostbyname (XSTRING (host)->data);
1400 if (host_info_ptr == 0) 1406 if (host_info_ptr == 0)
1401 /* Attempt to interpret host as numeric inet address */ 1407 /* Attempt to interpret host as numeric inet address */
1402 { 1408 {
1403 numeric_addr = inet_addr ((char *) XSTRING (host)->data); 1409 numeric_addr = inet_addr ((char *) XSTRING (host)->data);
1438 close (s); 1444 close (s);
1439 errno = xerrno; 1445 errno = xerrno;
1440 report_file_error ("connection failed", 1446 report_file_error ("connection failed",
1441 Fcons (host, Fcons (name, Qnil))); 1447 Fcons (host, Fcons (name, Qnil)));
1442 } 1448 }
1449 #else /* TERM */
1450 s = connect_server (0);
1451 if (s < 0)
1452 report_file_error ("error creating socket", Fcons (name, Qnil));
1453 send_command (s, C_PORT, 0, "%s:%d", XSTRING (host)->data, ntohs (port));
1454 send_command (s, C_DUMB, 1, 0);
1455 #endif /* TERM */
1443 1456
1444 inch = s; 1457 inch = s;
1445 outch = dup (s); 1458 outch = dup (s);
1446 if (outch < 0) 1459 if (outch < 0)
1447 report_file_error ("error duplicating socket", Fcons (name, Qnil)); 1460 report_file_error ("error duplicating socket", Fcons (name, Qnil));