diff options
-rw-r--r-- | Xtrans.c | 9 | ||||
-rw-r--r-- | Xtransint.h | 2 | ||||
-rw-r--r-- | Xtranslcl.c | 461 | ||||
-rw-r--r-- | Xtranssock.c | 8 | ||||
-rw-r--r-- | Xtransutil.c | 7 | ||||
-rw-r--r-- | xtrans.m4 | 2 |
6 files changed, 12 insertions, 477 deletions
@@ -78,7 +78,7 @@ from The Open Group. #define TRANS_LOCAL_PTS_INDEX 10 #define TRANS_LOCAL_NAMED_INDEX 11 /* 12 used to be ISC, but that's gone. */ -#define TRANS_LOCAL_SCO_INDEX 13 +/* 13 used to be SCO, but that's gone. */ #define TRANS_SOCKET_INET6_INDEX 14 #define TRANS_LOCAL_PIPE_INDEX 15 @@ -109,9 +109,6 @@ Xtransport_table Xtransports[] = { #ifdef __sun { &TRANS(PIPEFuncs), TRANS_LOCAL_PIPE_INDEX }, #endif /* __sun */ -#if defined(__SCO__) || defined(__UNIXWARE__) - { &TRANS(SCOFuncs), TRANS_LOCAL_SCO_INDEX }, -#endif /* __SCO__ || __UNIXWARE__ */ #endif /* LOCALCONN */ }; @@ -646,7 +643,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) break; case 1: /* Set to non-blocking mode */ -#if defined(O_NONBLOCK) && !defined(SCO325) +#if defined(O_NONBLOCK) ret = fcntl (fd, F_GETFL, 0); if (ret != -1) ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK); @@ -1318,7 +1315,7 @@ static int TRANS(WriteV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt) #endif /* WIN32 */ -#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__SVR4) || defined(__SCO__) +#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__SVR4) #ifndef NEED_UTSNAME #define NEED_UTSNAME #endif diff --git a/Xtransint.h b/Xtransint.h index ef3d739..fe1f117 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -98,7 +98,7 @@ from The Open Group. * to avoid a race condition. JKJ (6/5/97) */ -# if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__SVR4) || defined(__SCO__) +# if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__SVR4) # ifndef NEED_UTSNAME # define NEED_UTSNAME # endif diff --git a/Xtranslcl.c b/Xtranslcl.c index 26b7f63..995d76e 100644 --- a/Xtranslcl.c +++ b/Xtranslcl.c @@ -102,7 +102,6 @@ from The Open Group. /* Types of local connections supported: * - PTS * - named pipes - * - SCO */ #if !defined(__sun) # define LOCAL_TRANS_PTS @@ -110,9 +109,6 @@ from The Open Group. #if defined(SVR4) || defined(__SVR4) # define LOCAL_TRANS_NAMED #endif -#if defined(__SCO__) || defined(__UNIXWARE__) -# define LOCAL_TRANS_SCO -#endif static int TRANS(LocalClose)(XtransConnInfo ciptr); @@ -223,7 +219,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, #ifdef LOCAL_TRANS_PTS /* PTS */ -#if defined(SYSV) && !defined(__SCO__) +#if defined(SYSV) #define SIGNAL_T int #else #define SIGNAL_T void @@ -264,8 +260,6 @@ static void _dummy(int sig _X_UNUSED) #else #define NAMEDNODENAME "/dev/X/Nserver." -#define SCORNODENAME "/dev/X%1sR" -#define SCOSNODENAME "/dev/X%1sS" #endif /* !__sun */ #endif #if defined(XIM_t) @@ -274,8 +268,6 @@ static void _dummy(int sig _X_UNUSED) #else #define PTSNODENAME "/dev/X/XIM." #define NAMEDNODENAME "/dev/X/NXIM." -#define SCORNODENAME "/dev/XIM.%sR" -#define SCOSNODENAME "/dev/XIM.%sS" #endif #endif #if defined(FS_t) || defined (FONT_t) @@ -288,8 +280,6 @@ static void _dummy(int sig _X_UNUSED) */ #define PTSNODENAME "/dev/X/fontserver." #define NAMEDNODENAME "/dev/X/Nfontserver." -#define SCORNODENAME "/dev/fontserver.%sR" -#define SCOSNODENAME "/dev/fontserver.%sS" #endif #endif #if defined(ICE_t) @@ -298,8 +288,6 @@ static void _dummy(int sig _X_UNUSED) #else #define PTSNODENAME "/dev/X/ICE." #define NAMEDNODENAME "/dev/X/NICE." -#define SCORNODENAME "/dev/ICE.%sR" -#define SCOSNODENAME "/dev/ICE.%sS" #endif #endif #if defined(TEST_t) @@ -308,8 +296,6 @@ static void _dummy(int sig _X_UNUSED) #endif #define PTSNODENAME "/dev/X/transtest." #define NAMEDNODENAME "/dev/X/Ntranstest." -#define SCORNODENAME "/dev/transtest.%sR" -#define SCOSNODENAME "/dev/transtest.%sS" #endif @@ -935,343 +921,10 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) -#if defined(LOCAL_TRANS_SCO) - -/* - * connect_spipe is used by the SCO connection type. - */ -static int -connect_spipe(int fd1, int fd2) -{ - long temp; - struct strfdinsert sbuf; - - sbuf.databuf.maxlen = -1; - sbuf.databuf.len = -1; - sbuf.databuf.buf = NULL; - sbuf.ctlbuf.maxlen = sizeof(long); - sbuf.ctlbuf.len = sizeof(long); - sbuf.ctlbuf.buf = (caddr_t)&temp; - sbuf.offset = 0; - sbuf.fildes = fd2; - sbuf.flags = 0; - - if( ioctl(fd1, I_FDINSERT, &sbuf) < 0 ) - return(-1); - - return(0); -} - -/* - * named_spipe is used by the SCO connection type. - */ - -static int -named_spipe(int fd, char *path) - -{ - int oldUmask, ret; - struct stat sbuf; - - oldUmask = umask(0); - - (void) fstat(fd, &sbuf); - ret = mknod(path, 0020666, sbuf.st_rdev); - - umask(oldUmask); - - if (ret < 0) { - ret = -1; - } else { - ret = fd; - } - - return(ret); -} - -#endif /* defined(LOCAL_TRANS_SCO) */ -#ifdef LOCAL_TRANS_SCO -/* SCO */ - -/* - * 2002-11-09 (jkj@sco.com) - * - * This code has been modified to match what is in the actual SCO X server. - * This greatly helps inter-operability between X11R6 and X11R5 (the native - * SCO server). Mainly, it relies on streams nodes existing in /dev, not - * creating them or unlinking them, which breaks the native X server. - * - * However, this is only for the X protocol. For all other protocols, we - * do in fact create the nodes, as only X11R6 will use them, and this makes - * it possible to have both types of clients running, otherwise we get all - * kinds of nasty errors on startup for anything that doesnt use the X - * protocol (like SM, when KDE starts up). - */ - -#ifdef TRANS_CLIENT - -static int -TRANS(SCOOpenClient)(XtransConnInfo ciptr, const char *port) -{ -#ifdef SCORNODENAME - int fd, server, fl, ret; - char server_path[64]; - struct strbuf ctlbuf; - unsigned long alarm_time; - void (*savef)(); - long temp; - extern int getmsg(), putmsg(); -#endif - - prmsg(2,"SCOOpenClient(%s)\n", port); - if (!port || !port[0]) - port = "0"; - -#if !defined(SCORNODENAME) - prmsg(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n"); - return -1; -#else - (void) sprintf(server_path, SCORNODENAME, port); - - if ((server = open(server_path, O_RDWR)) < 0) { - prmsg(1,"SCOOpenClient: failed to open %s\n", server_path); - return -1; - } - - if ((fd = open(DEV_SPX, O_RDWR)) < 0) { - prmsg(1,"SCOOpenClient: failed to open %s\n", DEV_SPX); - close(server); - return -1; - } - - (void) write(server, &server, 1); - ctlbuf.len = 0; - ctlbuf.maxlen = sizeof(long); - ctlbuf.buf = (caddr_t)&temp; - fl = 0; - - savef = signal(SIGALRM, _dummy); - alarm_time = alarm(10); - - ret = getmsg(server, &ctlbuf, 0, &fl); - - (void) alarm(alarm_time); - (void) signal(SIGALRM, savef); - - if (ret < 0) { - prmsg(1,"SCOOpenClient: error from getmsg\n"); - close(fd); - close(server); - return -1; - } - - /* The msg we got via getmsg is the result of an - * I_FDINSERT, so if we do a putmsg with whatever - * we recieved, we're doing another I_FDINSERT ... - */ - (void) putmsg(fd, &ctlbuf, 0, 0); - (void) fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0)|O_NDELAY); - - (void) close(server); - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - -#if defined(X11_t) && defined(__SCO__) - ciptr->flags |= TRANS_NOUNLINK; -#endif - if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) - { - prmsg(1,"SCOOpenClient: failed to fill addr info\n"); - close(fd); - return -1; - } - - return(fd); - -#endif /* !SCORNODENAME */ -} - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static int -TRANS(SCOOpenServer)(XtransConnInfo ciptr, const char *port) -{ -#ifdef SCORNODENAME - char serverR_path[64]; - char serverS_path[64]; - struct flock mylock; - int fdr = -1; - int fds = -1; -#endif - - prmsg(2,"SCOOpenServer(%s)\n", port); - if (!port || !port[0]) - port = "0"; - -#if !defined(SCORNODENAME) - prmsg(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n"); - return -1; -#else - (void) sprintf(serverR_path, SCORNODENAME, port); - (void) sprintf(serverS_path, SCOSNODENAME, port); - -#if !defined(X11_t) || !defined(__SCO__) - unlink(serverR_path); - unlink(serverS_path); - - if ((fds = open(DEV_SPX, O_RDWR)) < 0 || - (fdr = open(DEV_SPX, O_RDWR)) < 0 ) { - prmsg(1,"SCOOpenServer: failed to open %s\n", DEV_SPX); - if (fds >= 0) - close(fds); - if (fdr >= 0) - close(fdr); - return -1; - } - - if (named_spipe (fds, serverS_path) == -1) { - prmsg(1,"SCOOpenServer: failed to create %s\n", serverS_path); - close (fdr); - close (fds); - return -1; - } - - if (named_spipe (fdr, serverR_path) == -1) { - prmsg(1,"SCOOpenServer: failed to create %s\n", serverR_path); - close (fdr); - close (fds); - return -1; - } -#else /* X11_t */ - - fds = open (serverS_path, O_RDWR | O_NDELAY); - if (fds < 0) { - prmsg(1,"SCOOpenServer: failed to open %s\n", serverS_path); - return -1; - } - - /* - * Lock the connection device for the duration of the server. - * This resolves multiple server starts especially on SMP machines. - */ - mylock.l_type = F_WRLCK; - mylock.l_whence = 0; - mylock.l_start = 0; - mylock.l_len = 0; - if (fcntl (fds, F_SETLK, &mylock) < 0) { - prmsg(1,"SCOOpenServer: failed to lock %s\n", serverS_path); - close (fds); - return -1; - } - - fdr = open (serverR_path, O_RDWR | O_NDELAY); - if (fdr < 0) { - prmsg(1,"SCOOpenServer: failed to open %s\n", serverR_path); - close (fds); - return -1; - } -#endif /* X11_t */ - - if (connect_spipe(fds, fdr)) { - prmsg(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n", - serverS_path); - close (fdr); - close (fds); - return -1; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - -#if defined(X11_t) && defined(__SCO__) - ciptr->flags |= TRANS_NOUNLINK; -#endif - if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) { - prmsg(1,"SCOOpenServer: failed to fill in addr info\n"); - close(fds); - close(fdr); - return -1; - } - - return(fds); - -#endif /* !SCORNODENAME */ -} - -static int -TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) -{ - char c; - int fd; - - prmsg(2,"SCOAccept(%d)\n", ciptr->fd); - - if (read(ciptr->fd, &c, 1) < 0) { - prmsg(1,"SCOAccept: can't read from client\n"); - *status = TRANS_ACCEPT_MISC_ERROR; - return(-1); - } - - if( (fd = open(DEV_SPX, O_RDWR)) < 0 ) { - prmsg(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX); - *status = TRANS_ACCEPT_MISC_ERROR; - return(-1); - } - - if (connect_spipe (ciptr->fd, fd) < 0) { - prmsg(1,"SCOAccept: ioctl(I_FDINSERT) failed\n"); - close (fd); - *status = TRANS_ACCEPT_MISC_ERROR; - return -1; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) { - prmsg(1, - "SCOAccept: failed to allocate memory for peer addr\n"); - close(fd); - *status = TRANS_ACCEPT_BAD_MALLOC; - return -1; - } - - memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); -#if defined(__SCO__) - newciptr->flags |= TRANS_NOUNLINK; -#endif - - newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr = malloc(newciptr->peeraddrlen)) == NULL ) { - prmsg(1, - "SCOAccept: failed to allocate memory for peer addr\n"); - free(newciptr->addr); - close(fd); - *status = TRANS_ACCEPT_BAD_MALLOC; - return -1; - } - - memcpy(newciptr->peeraddr,newciptr->addr,newciptr->peeraddrlen); - - *status = 0; - - return(fd); -} - -#endif /* TRANS_SERVER */ -#endif /* LOCAL_TRANS_SCO */ @@ -1359,41 +1012,6 @@ TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, const char *por #endif /* LOCAL_TRANS_NAMED */ -#ifdef LOCAL_TRANS_SCO -static int -TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, const char *port) - -{ -#ifdef SCORNODENAME - char serverR_path[64], serverS_path[64]; -#endif - - prmsg(2,"SCOReopenServer(%s)\n", port); - if (!port || !port[0]) - port = "0"; - -#if !defined(SCORNODENAME) - prmsg(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n"); - return 0; -#else - (void) sprintf(serverR_path, SCORNODENAME, port); - (void) sprintf(serverS_path, SCOSNODENAME, port); - -#if defined(X11_t) && defined(__SCO__) - ciptr->flags |= TRANS_NOUNLINK; -#endif - if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) - { - prmsg(1, "SCOReopenServer: failed to fill in addr info\n"); - return 0; - } - - return 1; - -#endif /* SCORNODENAME */ -} - -#endif /* LOCAL_TRANS_SCO */ #endif /* TRANS_REOPEN */ @@ -1638,30 +1256,6 @@ static LOCALtrans2dev LOCALtrans2devtab[] = { #endif /* LOCAL_TRANS_NAMED */ -#ifdef LOCAL_TRANS_SCO -{"sco", -#ifdef TRANS_CLIENT - TRANS(SCOOpenClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SCOOpenServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(OpenFail), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(OpenFail), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SCOReopenServer), - TRANS(ReopenFail), -#endif -#ifdef TRANS_SERVER - NULL, /* ResetListener */ - TRANS(SCOAccept) -#endif /* TRANS_SERVER */ -}, -#endif /* LOCAL_TRANS_SCO */ }; #define NUMTRANSPORTS (sizeof(LOCALtrans2devtab)/sizeof(LOCALtrans2dev)) @@ -1670,14 +1264,10 @@ static const char *XLOCAL=NULL; static char *workingXLOCAL=NULL; static char *freeXLOCAL=NULL; -#if defined(__SCO__) -#define DEF_XLOCAL "SCO:UNIX:PTS" -#elif defined(__UNIXWARE__) -#define DEF_XLOCAL "UNIX:PTS:NAMED:SCO" -#elif defined(__sun) +#if defined(__sun) #define DEF_XLOCAL "UNIX:NAMED" #else -#define DEF_XLOCAL "UNIX:PTS:NAMED:SCO" +#define DEF_XLOCAL "UNIX:PTS:NAMED" #endif static void @@ -2185,11 +1775,7 @@ TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend ) { prmsg(2,"LocalBytesReadable(%p->%d,%p)\n", ciptr, ciptr->fd, pend); -#if defined(SCO325) - return ioctl(ciptr->fd, I_NREAD, (char *)pend); -#else return ioctl(ciptr->fd, FIONREAD, (char *)pend); -#endif } static int @@ -2295,9 +1881,6 @@ static const char * local_aliases[] = { # ifdef __sun "pipe", /* compatibility with Solaris Xlib */ # endif -# ifdef LOCAL_TRANS_SCO - "sco", -# endif NULL }; #endif @@ -2459,41 +2042,3 @@ Xtransport TRANS(PIPEFuncs) = { #endif /* LOCAL_TRANS_NAMED */ -#ifdef LOCAL_TRANS_SCO -Xtransport TRANS(SCOFuncs) = { - /* Local Interface */ - "sco", - TRANS_LOCAL, -#ifdef TRANS_CLIENT - TRANS(LocalOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(LocalOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(LocalReopenCOTSServer), -#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), -#if XTRANS_SEND_FDS - TRANS(LocalSendFdInvalid), - TRANS(LocalRecvFdInvalid), -#endif - TRANS(LocalDisconnect), - TRANS(LocalClose), - TRANS(LocalCloseForCloning), -}; -#endif /* LOCAL_TRANS_SCO */ diff --git a/Xtranssock.c b/Xtranssock.c index 8d0766c..632c1b5 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -227,7 +227,7 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr); #if defined HAVE_SOCKLEN_T || (defined(IPv6) && defined(AF_INET6)) # define SOCKLEN_T socklen_t -#elif defined(SVR4) || defined(__SVR4) || defined(__SCO__) +#elif defined(SVR4) || defined(__SVR4) # define SOCKLEN_T size_t #else # define SOCKLEN_T int @@ -990,7 +990,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, const char *port, return TRANS_CREATE_LISTENER_FAILED; } -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) +#if defined(BSD44SOCKETS) sockname.sun_len = strlen(sockname.sun_path); #endif @@ -1068,7 +1068,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr) if (!abstract && ( stat (unsock->sun_path, &statb) == -1 || ((statb.st_mode & S_IFMT) != -#if defined(SCO325) || !defined(S_IFSOCK) +#if !defined(S_IFSOCK) S_IFIFO #else S_IFSOCK @@ -1864,7 +1864,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, return TRANS_CONNECT_FAILED; } -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) +#if defined(BSD44SOCKETS) sockname.sun_len = strlen (sockname.sun_path); #endif diff --git a/Xtransutil.c b/Xtransutil.c index 63f0fc3..f15be24 100644 --- a/Xtransutil.c +++ b/Xtransutil.c @@ -169,13 +169,6 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) } #endif /* defined(UNIXCONN) || defined(LOCALCONN) */ -#if (defined(__SCO__) || defined(__UNIXWARE__)) && defined(LOCALCONN) - case 0: - { - *familyp=FamilyLocal; - break; - } -#endif default: prmsg(1,"ConvertAddress: Unknown family type %d\n", @@ -122,7 +122,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ XTRANS_TCP_FLAGS fi [case $host_os in - solaris*|sco*|sysv4*) localdef="yes" ;; + solaris*|sysv4*) localdef="yes" ;; *) localdef="no" ;; esac] AC_ARG_ENABLE(local-transport, |