diff options
-rw-r--r-- | Xtrans.c | 54 | ||||
-rw-r--r-- | Xtrans.h | 10 | ||||
-rw-r--r-- | Xtransint.h | 27 | ||||
-rw-r--r-- | Xtranslcl.c | 416 | ||||
-rw-r--r-- | Xtranssock.c | 131 | ||||
-rw-r--r-- | Xtransutil.c | 15 | ||||
-rw-r--r-- | transport.c | 6 |
7 files changed, 28 insertions, 631 deletions
@@ -101,9 +101,6 @@ Xtransport_table Xtransports[] = { #endif /* !LOCALCONN */ { &TRANS(SocketUNIXFuncs), TRANS_SOCKET_UNIX_INDEX }, #endif /* UNIXCONN */ -#if defined(OS2PIPECONN) - { &TRANS(OS2LocalFuncs), TRANS_LOCAL_LOCAL_INDEX }, -#endif /* OS2PIPECONN */ #if defined(LOCALCONN) { &TRANS(LocalFuncs), TRANS_LOCAL_LOCAL_INDEX }, #ifndef sun @@ -719,7 +716,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) break; case 1: /* Set to non-blocking mode */ -#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3) && !defined(uniosu) && !defined(__UNIXOS2__) && !defined(SCO325)) && !defined(__QNX__) +#if defined(O_NONBLOCK) && !defined(SCO325) ret = fcntl (fd, F_GETFL, 0); if (ret != -1) ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK); @@ -731,7 +728,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) ret = ioctl (fd, FIOSNBIO, &arg); } #else -#if (defined(AIXV3) || defined(uniosu) || defined(WIN32) || defined(__UNIXOS2__) || defined(__QNX__)) && defined(FIONBIO) +#if defined(WIN32) { #ifdef WIN32 u_long arg; @@ -741,11 +738,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) arg = 1; /* IBM TCP/IP understands this option too well: it causes TRANS(Read) to fail * eventually with EWOULDBLOCK */ -#ifndef __UNIXOS2__ ret = ioctl (fd, FIONBIO, &arg); -#else -/* ret = ioctl(fd, FIONBIO, &arg, sizeof(int));*/ -#endif } #else ret = fcntl (fd, F_GETFL, 0); @@ -1292,45 +1285,8 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret, * may be used by it. */ -#ifdef CRAY - -/* - * Cray UniCOS does not have readv and writev so we emulate - */ - -static int TRANS(ReadV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt) - -{ - struct msghdr hdr; - - hdr.msg_iov = iov; - hdr.msg_iovlen = iovcnt; - hdr.msg_accrights = 0; - hdr.msg_accrightslen = 0; - hdr.msg_name = 0; - hdr.msg_namelen = 0; - - return (recvmsg (ciptr->fd, &hdr, 0)); -} - -static int TRANS(WriteV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt) - -{ - struct msghdr hdr; - - hdr.msg_iov = iov; - hdr.msg_iovlen = iovcnt; - hdr.msg_accrights = 0; - hdr.msg_accrightslen = 0; - hdr.msg_name = 0; - hdr.msg_namelen = 0; - - return (sendmsg (ciptr->fd, &hdr, 0)); -} - -#endif /* CRAY */ -#if (defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) /* * emulate readv @@ -1362,7 +1318,7 @@ static int TRANS(ReadV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt) #endif /* SYSV && __i386__ || WIN32 || __sxg__ */ -#if (defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) /* * emulate writev @@ -1395,7 +1351,7 @@ static int TRANS(WriteV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt) #endif /* SYSV && __i386__ || WIN32 || __sxg__ */ -#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(__SCO__) +#if defined(_POSIX_SOURCE) || defined(USG) || defined(SVR4) || defined(__SCO__) #ifndef NEED_UTSNAME #define NEED_UTSNAME #endif @@ -54,11 +54,7 @@ from The Open Group. #include <X11/Xos.h> #ifndef WIN32 -#ifndef Lynx #include <sys/socket.h> -#else -#include <socket.h> -#endif #endif @@ -194,7 +190,7 @@ typedef long BytesReadable_t; #endif -#if defined(WIN32) || (defined(USG) && !defined(CRAY) && !defined(umips) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__)) +#if defined(WIN32) || defined(USG) /* * TRANS(Readv) and TRANS(Writev) use struct iovec, normally found @@ -208,11 +204,7 @@ struct iovec { }; #else -#ifndef Lynx #include <sys/uio.h> -#else -#include <uio.h> -#endif #endif typedef struct _XtransConnInfo *XtransConnInfo; diff --git a/Xtransint.h b/Xtransint.h index e14b26c..f9ee8f9 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -69,11 +69,7 @@ from The Open Group. */ #ifndef XTRANSDEBUG -# ifndef __UNIXOS2__ # define XTRANSDEBUG 1 -# else -# define XTRANSDEBUG 1 -# endif #endif #ifdef WIN32 @@ -89,23 +85,16 @@ from The Open Group. #include <errno.h> #ifndef WIN32 -# ifndef Lynx # include <sys/socket.h> -# else -# include <socket.h> -# endif # include <netinet/in.h> # include <arpa/inet.h> -# ifdef __UNIXOS2__ -# include <sys/ioctl.h> -# endif /* * Moved the setting of NEED_UTSNAME to this header file from Xtrans.c, * to avoid a race condition. JKJ (6/5/97) */ -# if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(__SCO__) +# if defined(_POSIX_SOURCE) || defined(USG) || defined(SVR4) || defined(__SCO__) # ifndef NEED_UTSNAME # define NEED_UTSNAME # endif @@ -128,7 +117,7 @@ from The Open Group. # endif # endif # ifndef OPEN_MAX -# if defined(_SC_OPEN_MAX) && !defined(__UNIXOS2__) +# if defined(_SC_OPEN_MAX) # define OPEN_MAX (sysconf(_SC_OPEN_MAX)) # else # ifdef SVR4 @@ -142,11 +131,7 @@ from The Open Group. # ifdef NOFILE # define OPEN_MAX NOFILE # else -# if !defined(__UNIXOS2__) && !defined(__QNX__) # define OPEN_MAX NOFILES_MAX -# else -# define OPEN_MAX 256 -# endif # endif # endif # endif @@ -165,11 +150,7 @@ from The Open Group. # endif /* TRANS_OPEN_MAX */ -# ifdef __UNIXOS2__ -# define ESET(val) -# else # define ESET(val) errno = val -# endif # define EGET() errno #else /* WIN32 */ @@ -380,7 +361,7 @@ typedef struct _Xtransport_table { * systems, so they may be emulated. */ -#if defined(CRAY) || (defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) #define READV(ciptr, iov, iovcnt) TRANS(ReadV)(ciptr, iov, iovcnt) @@ -397,7 +378,7 @@ static int TRANS(ReadV)( #endif /* CRAY || (SYSV && __i386__) || WIN32 || __sxg__ || */ -#if defined(CRAY) || (defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) #define WRITEV(ciptr, iov, iovcnt) TRANS(WriteV)(ciptr, iov, iovcnt) diff --git a/Xtranslcl.c b/Xtranslcl.c index addbc62..f6a2468 100644 --- a/Xtranslcl.c +++ b/Xtranslcl.c @@ -76,12 +76,7 @@ from The Open Group. #include <sys/ioctl.h> #include <sys/stat.h> #if defined(SVR4) -#if !defined(DGUX) #include <sys/filio.h> -#else /* DGUX */ -#include <sys/stream.h> -#include <sys/ptms.h> -#endif #endif #ifdef sun # include <stropts.h> @@ -103,10 +98,6 @@ from The Open Group. #include <sys/un.h> #endif -#if defined(ISC) && !defined(_POSIX_SOURCE) -typedef unsigned short mode_t; -/* POSIX needed for mode_t define in sys/types.h */ -#endif /* Types of local connections supported: * - PTS @@ -120,10 +111,6 @@ typedef unsigned short mode_t; #if defined(SVR4) || defined(__SVR4) # define LOCAL_TRANS_NAMED #endif -#if !defined(sun) && !defined(__SCO__) && !defined(__UNIXWARE__) -/* SCO doesnt use the ISC transport type - it causes problems */ -# define LOCAL_TRANS_ISC -#endif #if defined(__SCO__) || defined(__UNIXWARE__) # define LOCAL_TRANS_SCO #endif @@ -179,7 +166,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) return 0; } strcpy (sunaddr->sun_path, sun_path); -#if defined(BSD44SOCKETS) && !defined(Lynx) +#if defined(BSD44SOCKETS) sunaddr->sun_len = strlen (sunaddr->sun_path); #endif @@ -206,7 +193,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) return 0; } strcpy (p_sunaddr->sun_path, peer_sun_path); -#if defined(BSD44SOCKETS) && !defined(Lynx) +#if defined(BSD44SOCKETS) p_sunaddr->sun_len = strlen (p_sunaddr->sun_path); #endif @@ -220,7 +207,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) #ifdef LOCAL_TRANS_PTS /* PTS */ -#if defined(SYSV) && !defined(__SCO__) && !defined(ISC) +#if defined(SYSV) && !defined(__SCO__) #define SIGNAL_T int #else #define SIGNAL_T void @@ -251,11 +238,7 @@ static void _dummy(int sig) #endif #endif -#ifdef _AIX -#define DEV_PTMX "/dev/ptc" -#else #define DEV_PTMX "/dev/ptmx" -#endif #if defined(X11_t) @@ -270,9 +253,6 @@ static void _dummy(int sig) * backwards binary compatability only. */ -#define X_ISC_DIR "/dev/X/ISCCONN" -#define ISCDEVNODENAME "/dev/X/ISCCONN/X%s" -#define ISCTMPNODENAME "/tmp/.X11-unix/X%s" #define SCORNODENAME "/dev/X%1sR" #define SCOSNODENAME "/dev/X%1sS" #endif /* !sun */ @@ -657,7 +637,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) sunaddr->sun_family=AF_UNIX; strcpy(sunaddr->sun_path,buf); -#if defined(BSD44SOCKETS) && !defined(Lynx) +#if defined(BSD44SOCKETS) sunaddr->sun_len=strlen(sunaddr->sun_path); #endif @@ -950,7 +930,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) -#if defined(LOCAL_TRANS_ISC) || defined(LOCAL_TRANS_SCO) +#if defined(LOCAL_TRANS_SCO) /* * connect_spipe is used by the SCO and ISC connection types. @@ -1004,294 +984,9 @@ named_spipe(int fd, char *path) return(ret); } -#endif /* defined(LOCAL_TRANS_ISC) || defined(LOCAL_TRANS_SCO) */ +#endif /* defined(LOCAL_TRANS_SCO) */ -#if defined(LOCAL_TRANS_ISC) - - -/* ISC */ - -#ifdef TRANS_CLIENT - -static int -TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port) - -{ -#ifdef ISCDEVNODENAME - int fd,fds,server; - char server_path[64]; - char server_dev_path[64]; - struct strfdinsert buf; - long temp; - mode_t spmode; - struct stat filestat; -#endif - - PRMSG(2,"ISCOpenClient(%s)\n", port, 0,0 ); - -#if !defined(ISCDEVNODENAME) - PRMSG(1,"ISCOpenClient: Protocol is not supported by a ISC connection\n", 0,0,0); - return -1; -#else - (void) sprintf(server_path, ISCTMPNODENAME, port); - (void) sprintf(server_dev_path, ISCDEVNODENAME, port); - - fd = fds = server = -1; - - if (stat(DEV_SPX, &filestat) == -1) { - PRMSG(1, "ISCOpenClient: stat(%s) failed, errno=%d\n", DEV_SPX, errno, 0 ); - return(-1); - } - - spmode = (filestat.st_mode & S_IFMT); - - if (stat(server_path, &filestat) != -1) { - if ((filestat.st_mode & S_IFMT) == spmode) { - if ((server = open(server_path, O_RDWR)) < 0) { - PRMSG(1,"ISCOpenClient: failed to open %s\n", - server_path, 0,0 ); - } - } - } - - if (server < 0) { - /* try the alternate path */ - if (stat(server_dev_path, &filestat) != -1) { - if ((filestat.st_mode & S_IFMT) == spmode) { - if ((server = open(server_dev_path, O_RDWR)) < 0) { - PRMSG(1,"ISCOpenClient: failed to open %s\n", - server_dev_path, 0,0 ); - } - } - } - } - - if (server < 0) { - PRMSG(1,"ISCOpenClient: can't open either device %s or %s\n", - server_path, server_dev_path, 0 ); - return -1; - } - - if ((fds = open(DEV_SPX, O_RDWR)) < 0 || - (fd = open(DEV_SPX, O_RDWR)) < 0) { - /* Failed to open all of the devices */ - PRMSG(1,"ISCOpenClient: can't open %s\n", DEV_SPX, 0,0 ); - (void) close(server); - if (fds != -1) - (void) close(fds); - if (fd != -1) - (void) close(fd); - return -1; - } - - /* make a STREAMS-pipe */ - - buf.databuf.maxlen = -1; - buf.databuf.len = -1; - buf.databuf.buf = NULL; - buf.ctlbuf.maxlen = sizeof(long); - buf.ctlbuf.len = sizeof(long); - buf.ctlbuf.buf = (caddr_t)&temp; - buf.offset = 0; - buf.fildes = fd; - buf.flags = 0; - - if (ioctl(fds, I_FDINSERT, &buf) < 0 || - ioctl(server, I_SENDFD, fds) < 0) { - PRMSG(1,"ISCOpenClient: ioctl(I_FDINSERT or I_SENDFD) failed\n", - 0,0,0 ); - (void) close(server); - (void) close(fds); - (void) close(fd); - return -1; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) - { - PRMSG(1,"ISCOpenClient: failed to fill in addr info\n", 0, 0, 0); - close(fd); - return -1; - } - - return (fd); - -#endif /* !ISCDEVNODENAME */ -} - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static int -TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port) - -{ -#ifdef ISCDEVNODENAME - int fd = -1,fds = -1; - char server_path[64],server_unix_path[64]; - unsigned int mode = 0; -#endif - - PRMSG(2,"ISCOpenServer(%s)\n", port, 0,0 ); - -#if !defined(ISCDEVNODENAME) - PRMSG(1,"ISCOpenServer: Protocol is not supported by a ISC connection\n", 0,0,0); - return -1; -#else - (void) sprintf(server_path, ISCDEVNODENAME, port); - (void) sprintf(server_unix_path, ISCTMPNODENAME, port); - -#ifdef HAS_STICKY_DIR_BIT - mode = 01777; -#else - mode = 0777; -#endif - - /* "/dev/X" */ - if (trans_mkdir(X_STREAMS_DIR, mode) == -1) { - PRMSG (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n", - X_STREAMS_DIR, errno, 0); - return(-1); - } - /* "/dev/X/ISCCONN" */ - if (trans_mkdir(X_ISC_DIR, mode) == -1) { - PRMSG (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n", - X_ISC_DIR, errno, 0); - return(-1); - } - - unlink(server_path); - - if( ((fds=open(DEV_SPX, O_RDWR)) < 0) || - ((fd =open(DEV_SPX, O_RDWR)) < 0)) { - PRMSG(1,"ISCOpenServer: failed to open %s\n", DEV_SPX, 0,0 ); - return -1; - } - - if( (connect_spipe(fds, fd) < 0) || - (named_spipe(fds, server_path) < 0)) { - PRMSG(1,"ISCOpenServer: failed connect pipes\n", 0,0,0 ); - close(fd); - close(fds); - return -1; - } - -#if !defined(UNIXCONN) - /* - * If the UNIX Domain socket transport is not being used, then link this - * device to the path /tmp/.X11-unix/X path. - */ -#define X_UNIX_DIR "/tmp/.X11-unix" - - if (trans_mkdir(X_UNIX_DIR, mode) == -1) { - PRMSG (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n", - X_UNIX_DIR, errno, 0); - return(-1); - } - - unlink(server_unix_path); - -#ifdef SVR4 - /* we prefer symbolic links because hard links can't cross file systems */ - if( symlink(server_path, server_unix_path) < 0 ) - PRMSG(1,"ISCOpenServer: failed to link %s to %s\n", - server_path, server_unix_path, 0 ); - /* - * Don't make this failure fatal since the listener - * is already established, and this just for compatability - */ -#else -#ifdef ISC40 - /* catch SIGSYS on symlink for ISC40 compiled binaries running on ISC30 */ - signal(SIGSYS,_dummy); -#endif - if( link(server_path, server_unix_path) < 0 ) -#ifdef ISC40 - if( symlink(server_path, server_unix_path) < 0 ) -#endif - PRMSG(1,"ISCOpenServer: failed to link %s to %s\n", - server_path, server_unix_path, 0 ); - /* - * Don't make this failure fatal since the listener - * is already established, and this just for compatability - */ -#endif /* SVR4 */ -#endif /* !UNIXCONN */ - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) - { - PRMSG(1,"ISCOpenServer: failed to fill in addr info\n", 0, 0, 0); - close(fd); - return -1; - } - - return fd; - -#endif /* !ISCDEVNODENAME */ -} - -static int -TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) - -{ - struct strrecvfd str; - - PRMSG(2,"ISCAccept(%d)\n", ciptr->fd, 0,0 ); - - while (ioctl(ciptr->fd, I_RECVFD, &str) < 0) { - if (errno != EAGAIN) { - PRMSG(1,"ISCAccept: Can't read fildes", 0,0,0 ); - *status = TRANS_ACCEPT_MISC_ERROR; - return(-1); - } - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { - PRMSG(1, - "ISCAccept: failed to allocate memory for peer addr\n", - 0,0,0); - close(str.fd); - *status = TRANS_ACCEPT_BAD_MALLOC; - return -1; - } - - memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); - - newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { - PRMSG(1, - "ISCAccept: failed to allocate memory for peer addr\n", - 0,0,0); - xfree(newciptr->addr); - close(str.fd); - *status = TRANS_ACCEPT_BAD_MALLOC; - return -1; - } - - memcpy(newciptr->peeraddr,newciptr->addr,newciptr->peeraddrlen); - - *status = 0; - - return(str.fd); -} - -#endif /* TRANS_SERVER */ -#endif /* LOCAL_TRANS_ISC */ #ifdef LOCAL_TRANS_SCO @@ -1654,35 +1349,6 @@ TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd, char *port) #endif /* LOCAL_TRANS_NAMED */ -#ifdef LOCAL_TRANS_ISC -static int -TRANS(ISCReopenServer)(XtransConnInfo ciptr, int fd, char *port) - -{ -#ifdef ISCDEVNODENAME - char server_path[64], server_unix_path[64]; -#endif - - PRMSG(2,"ISCReopenServer(%s)\n", port, 0,0 ); - -#if !defined(ISCDEVNODENAME) - PRMSG(1,"ISCReopenServer: Protocol is not supported by a ISC connection\n", 0,0,0); - return 0; -#else - (void) sprintf(server_path, ISCDEVNODENAME, port); - (void) sprintf(server_unix_path, ISCTMPNODENAME, port); - - if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) - { - PRMSG(1, "ISCReopenServer: failed to fill in addr info\n", 0,0,0); - return 0; - } - - return 1; - -#endif /* !ISCDEVNODENAME */ -} -#endif /* LOCAL_TRANS_ISC */ #ifdef LOCAL_TRANS_SCO static int @@ -1962,30 +1628,6 @@ static LOCALtrans2dev LOCALtrans2devtab[] = { #endif /* sun */ #endif /* LOCAL_TRANS_NAMED */ -#ifdef LOCAL_TRANS_ISC -{"isc", -#ifdef TRANS_CLIENT - TRANS(ISCOpenClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(ISCOpenServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(OpenFail), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(OpenFail), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(ISCReopenServer), - TRANS(ReopenFail), -#endif -#ifdef TRANS_SERVER - NULL, /* ResetListener */ - TRANS(ISCAccept) -#endif /* TRANS_SERVER */ -}, -#endif /* LOCAL_TRANS_ISC */ #ifdef LOCAL_TRANS_SCO {"sco", @@ -2590,7 +2232,7 @@ TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend ) { PRMSG(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend); -#if defined(ISC) || defined(SCO325) +#if defined(SCO325) return ioctl(ciptr->fd, I_NREAD, (char *)pend); #else return ioctl(ciptr->fd, FIONREAD, (char *)pend); @@ -2700,9 +2342,6 @@ static char * local_aliases[] = { # ifdef sun "pipe", /* compatibility with Solaris Xlib */ # endif -# ifdef LOCAL_TRANS_ISC - "isc", -# endif # ifdef LOCAL_TRANS_SCO "sco", # endif @@ -2878,47 +2517,6 @@ Xtransport TRANS(PIPEFuncs) = { #endif /* sun */ #endif /* LOCAL_TRANS_NAMED */ -#ifdef LOCAL_TRANS_ISC -Xtransport TRANS(ISCFuncs) = { - /* Local Interface */ - "isc", - TRANS_LOCAL, -#ifdef TRANS_CLIENT - TRANS(LocalOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(LocalOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(LocalOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(LocalOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(LocalReopenCOTSServer), - TRANS(LocalReopenCLTSServer), -#endif - TRANS(LocalSetOption), -#ifdef TRANS_SERVER - TRANS(LocalCreateListener), - TRANS(LocalResetListener), - TRANS(LocalAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(LocalConnect), -#endif /* TRANS_CLIENT */ - TRANS(LocalBytesReadable), - TRANS(LocalRead), - TRANS(LocalWrite), - TRANS(LocalReadv), - TRANS(LocalWritev), - TRANS(LocalDisconnect), - TRANS(LocalClose), - TRANS(LocalCloseForCloning), -}; -#endif /* LOCAL_TRANS_ISC */ #ifdef LOCAL_TRANS_SCO Xtransport TRANS(SCOFuncs) = { diff --git a/Xtranssock.c b/Xtranssock.c index ff37782..bb1c792 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -69,21 +69,14 @@ from the copyright holders. #ifdef UNIXCONN #ifndef X_NO_SYS_UN -#ifndef Lynx #include <sys/un.h> -#else -#include <un.h> -#endif #endif #include <sys/stat.h> #endif -#if defined(hpux) || (defined(MOTOROLA) && defined(SYSV)) -#define NO_TCP_H -#endif #ifndef NO_TCP_H -#if defined(__osf__) || defined(linux) || defined(__GLIBC__) || defined(AIXV5) +#if defined(linux) || defined(__GLIBC__) #include <sys/param.h> #endif /* osf */ #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) @@ -94,7 +87,7 @@ from the copyright holders. #endif /* !NO_TCP_H */ #include <sys/ioctl.h> -#if defined(SVR4) && !defined(DGUX) && !defined(_SEQUENT_) +#if defined(SVR4) #include <sys/filio.h> #endif @@ -102,7 +95,7 @@ from the copyright holders. #include <net/errno.h> #endif -#if (defined(__i386__) && defined(SYSV)) && (!defined(ISC) || !defined(I_NREAD) || defined(SCO325)) || defined(_SEQUENT_) +#if defined(__i386__) && defined(SYSV) #include <sys/stropts.h> #endif @@ -130,33 +123,8 @@ from the copyright holders. #undef SO_DONTLINGER #endif -#if defined(__UNIXOS2__) -#if defined(NOT_EMX09A) -static int IBMsockInit = 0; -#define SocketInitOnce()\ - if (!IBMsockInit) {\ - sock_init();\ - IBMsockInit = 1;\ - } -#undef EINTR -#define EINTR SOCEINTR -#undef EINVAL -#define EINVAL SOCEINVAL -#undef errno -#define errno sock_errno() -#undef close -#define close soclose -#undef ioctl -#define ioctl sockioctl -#else -#define SocketInitOnce() /**/ -#endif -/* this is still not there */ -#define SOCKET int -#else /* others don't need this */ #define SocketInitOnce() /**/ -#endif #ifdef linux #define HAVE_ABSTRACT_SOCKETS @@ -215,36 +183,6 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr); #ifdef UNIXCONN -#ifdef hpux - -#if defined(X11_t) -#define UNIX_PATH "/usr/spool/sockets/X11/" -#define UNIX_DIR "/usr/spool/sockets/X11" -#define OLD_UNIX_PATH "/tmp/.X11-unix/X" -#endif /* X11_t */ -#if defined(XIM_t) -#define UNIX_PATH "/usr/spool/sockets/XIM/" -#define UNIX_DIR "/usr/spool/sockets/XIM" -#define OLD_UNIX_PATH "/tmp/.XIM-unix/XIM" -#endif /* XIM_t */ -#if defined(FS_t) || defined(FONT_t) -#define UNIX_PATH "/usr/spool/sockets/fontserv/" -#define UNIX_DIR "/usr/spool/sockets/fontserv" -#endif /* FS_t || FONT_t */ -#if defined(ICE_t) -#define UNIX_PATH "/usr/spool/sockets/ICE/" -#define UNIX_DIR "/usr/spool/sockets/ICE" -#endif /* ICE_t */ -#if defined(TEST_t) -#define UNIX_PATH "/usr/spool/sockets/xtrans_test/" -#define UNIX_DIR "/usr/spool/sockets/xtrans_test" -#endif -#if defined(LBXPROXY_t) -#define UNIX_PATH "/usr/spool/sockets/X11/" -#define UNIX_DIR "/usr/spool/sockets/X11" -#endif - -#else /* !hpux */ #if defined(X11_t) #define UNIX_PATH "/tmp/.X11-unix/X" @@ -271,7 +209,6 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr); #define UNIX_DIR "/tmp/.X11-unix" #endif -#endif /* hpux */ #endif /* UNIXCONN */ @@ -1168,7 +1105,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port, return TRANS_CREATE_LISTENER_FAILED; } -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) +#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) sockname.sun_len = strlen(sockname.sun_path); #endif @@ -1722,25 +1659,11 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) return TRANS_CONNECT_FAILED; } -#if defined(CRAY) && defined(OLDTCP) - /* Only Cray UNICOS3 and UNICOS4 will define this */ - { - long t; - memcpy ((char *)&t, (char *) hostp->h_addr, sizeof (t)); - sockname.sin_addr = t; - } -#else memcpy ((char *) &sockname.sin_addr, (char *) hostp->h_addr, sizeof (sockname.sin_addr)); -#endif /* CRAY and OLDTCP */ } else { -#if defined(CRAY) && defined(OLDTCP) - /* Only Cray UNICOS3 and UNICOS4 will define this */ - sockname.sin_addr = tmpaddr; -#else sockname.sin_addr.s_addr = tmpaddr; -#endif /* CRAY and OLDTCP */ } /* @@ -2029,10 +1952,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) struct sockaddr_un sockname; SOCKLEN_T namelen; -#if defined(hpux) && defined(X11_t) - struct sockaddr_un old_sockname; - SOCKLEN_T old_namelen; -#endif int abstract = 0; #ifdef HAVE_ABSTRACT_SOCKETS @@ -2080,7 +1999,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) return TRANS_CONNECT_FAILED; } -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) +#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) sockname.sun_len = strlen (sockname.sun_path); #endif @@ -2091,18 +2010,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) #endif -#if defined(hpux) && defined(X11_t) - /* - * This is gross, but it was in Xlib - */ - old_sockname.sun_family = AF_UNIX; - if (set_sun_path(port, OLD_UNIX_PATH, old_sockname.sun_path, abstract) != 0) { - PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - old_namelen = strlen (old_sockname.sun_path) + - offsetof(struct sockaddr_un, sun_path); -#endif /* * Adjust the socket path if using abstract sockets. @@ -2111,9 +2018,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) if (abstract) { sockname.sun_path[0] = '\0'; -#if defined(hpux) && defined(X11_t) - old_sockname.sun_path[0] = '\0'; -#endif } /* @@ -2125,18 +2029,6 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) int olderrno = errno; int connected = 0; -#if defined(hpux) && defined(X11_t) - if (olderrno == ENOENT) - { - if (connect (ciptr->fd, - (struct sockaddr *) &old_sockname, old_namelen) >= 0) - { - connected = 1; - } - else - olderrno = errno; - } -#endif if (!connected) { errno = olderrno; @@ -2215,9 +2107,6 @@ TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend) { PRMSG (2,"SocketBytesReadable(%p,%d,%p)\n", ciptr, ciptr->fd, pend); -#if defined(QNX4) - *pend = 0L; /* FIONREAD only returns a short. Zero out upper bits */ -#endif #ifdef WIN32 { int ret = ioctlsocket ((SOCKET) ciptr->fd, FIONREAD, (u_long *) pend); @@ -2225,14 +2114,10 @@ TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend) return ret; } #else -#if (defined(__i386__) && defined(SYSV) && !defined(SCO325)) || (defined(_SEQUENT_) && _SOCKET_VERSION == 1) +#if defined(__i386__) && defined(SYSV) && !defined(SCO325) return ioctl (ciptr->fd, I_NREAD, (char *) pend); #else -#if defined(__UNIXOS2__) - return ioctl (ciptr->fd, FIONREAD, (char*) pend, sizeof(int)); -#else return ioctl (ciptr->fd, FIONREAD, (char *) pend); -#endif /* __UNIXOS2__ */ #endif /* __i386__ && SYSV || _SEQUENT_ && _SOCKET_VERSION == 1 */ #endif /* WIN32 */ } @@ -2244,7 +2129,7 @@ TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size) { PRMSG (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size); -#if defined(WIN32) || defined(__UNIXOS2__) +#if defined(WIN32) { int ret = recv ((SOCKET)ciptr->fd, buf, size, 0); #ifdef WIN32 @@ -2264,7 +2149,7 @@ TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size) { PRMSG (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size); -#if defined(WIN32) || defined(__UNIXOS2__) +#if defined(WIN32) { int ret = send ((SOCKET)ciptr->fd, buf, size, 0); #ifdef WIN32 diff --git a/Xtransutil.c b/Xtransutil.c index f68b1e7..ea9e650 100644 --- a/Xtransutil.c +++ b/Xtransutil.c @@ -104,17 +104,8 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) */ struct sockaddr_in saddr; -#ifdef CRAY -#ifdef OLDTCP - int len = sizeof(saddr.sin_addr); -#else - int len = SIZEOF_in_addr; -#endif /* OLDTCP */ - char *cp = (char *) &saddr.sin_addr; -#else /* else not CRAY */ int len = sizeof(saddr.sin_addr.s_addr); char *cp = (char *) &saddr.sin_addr.s_addr; -#endif /* CRAY */ memcpy (&saddr, *addrp, sizeof (struct sockaddr_in)); @@ -184,7 +175,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) } #endif /* defined(DNETCONN) */ -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) +#if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: { *familyp=FamilyLocal; @@ -267,7 +258,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) switch (family) { -#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) +#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) case AF_UNIX: { struct sockaddr_un *saddr = (struct sockaddr_un *) addr; @@ -369,7 +360,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr) switch (family) { case AF_UNSPEC: -#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) +#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) case AF_UNIX: { if (gethostname (addrbuf, sizeof (addrbuf)) == 0) diff --git a/transport.c b/transport.c index 0d1eaf9..7ffb3de 100644 --- a/transport.c +++ b/transport.c @@ -47,9 +47,6 @@ from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif #ifdef XSERV_t #include "os.h" @@ -69,9 +66,6 @@ from The Open Group. #ifdef LOCALCONN #include "Xtranslcl.c" #endif -#ifdef OS2PIPECONN -#include "Xtransos2.c" -#endif #if defined(TCPCONN) || defined(UNIXCONN) #include "Xtranssock.c" #endif |