summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKean Johnson <kean@armory.com>2005-06-10 06:54:04 +0000
committerKean Johnson <kean@armory.com>2005-06-10 06:54:04 +0000
commitb1789221d03ebb20c83dbf52edf71d1609c6030f (patch)
tree865ec7e02e75026170134cf519b078b445b02882
parentc814f30e9a5dc48a24c20517334cf5f9c37e066a (diff)
downloadxorg-lib-libxtrans-sco_port_update.tar.gz
SCO port update for SCO OpenServer 5 and UnixWare 7. A few general cleanupssco_port_update
and bugs not specifically related to the port fixed along the way.
-rw-r--r--Xtrans.c10
-rw-r--r--Xtransint.h6
-rw-r--r--Xtranslcl.c159
-rw-r--r--Xtranssock.c18
-rw-r--r--Xtransutil.c8
5 files changed, 118 insertions, 83 deletions
diff --git a/Xtrans.c b/Xtrans.c
index 1a3c49c..3ffcb33 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -117,7 +117,7 @@ Xtransport_table Xtransports[] = {
{ &TRANS(NAMEDFuncs), TRANS_LOCAL_NAMED_INDEX },
#endif
#ifndef sun
-#ifndef SCO325
+#if !defined(__SCO__) && !defined(__UNIXWARE__)
{ &TRANS(ISCFuncs), TRANS_LOCAL_ISC_INDEX },
#endif
{ &TRANS(SCOFuncs), TRANS_LOCAL_SCO_INDEX },
@@ -712,7 +712,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(SCO)) && !defined(__QNX__)
+#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3) && !defined(uniosu) && !defined(__UNIXOS2__) && !defined(SCO325)) && !defined(__QNX__)
ret = fcntl (fd, F_GETFL, 0);
if (ret != -1)
ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK);
@@ -1303,7 +1303,7 @@ static int TRANS(WriteV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt)
#endif /* CRAY */
-#if (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
+#if (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
/*
* emulate readv
@@ -1335,7 +1335,7 @@ static int TRANS(ReadV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt)
#endif /* SYSV && i386 || WIN32 || __sxg__ */
-#if (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
+#if (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
/*
* emulate writev
@@ -1368,7 +1368,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(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(__SCO__)
#ifndef NEED_UTSNAME
#define NEED_UTSNAME
#endif
diff --git a/Xtransint.h b/Xtransint.h
index 50a41cc..10bd135 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -110,7 +110,7 @@ from The Open Group.
* 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(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(__SCO__)
# ifndef NEED_UTSNAME
# define NEED_UTSNAME
# endif
@@ -383,7 +383,7 @@ typedef struct _Xtransport_table {
* systems, so they may be emulated.
*/
-#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
+#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
#define READV(ciptr, iov, iovcnt) TRANS(ReadV)(ciptr, iov, iovcnt)
@@ -400,7 +400,7 @@ static int TRANS(ReadV)(
#endif /* CRAY || (SYSV && i386) || WIN32 || __sxg__ || */
-#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
+#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__)
#define WRITEV(ciptr, iov, iovcnt) TRANS(WriteV)(ciptr, iov, iovcnt)
diff --git a/Xtranslcl.c b/Xtranslcl.c
index fd68289..01532d2 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -146,8 +146,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if ((sunaddr = (struct sockaddr_un *) xalloc (ciptr->addrlen)) == NULL)
{
- PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n",
- 0,0,0);
+ PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0);
return 0;
}
@@ -198,7 +197,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
/* PTS */
-#if defined(SYSV) && !defined(sco) && !defined(SCO) && !defined(ISC)
+#if defined(SYSV) && !defined(__SCO__) && !defined(ISC)
#define SIGNAL_T int
#else
#define SIGNAL_T void
@@ -239,7 +238,7 @@ static void _dummy(int sig)
#endif
/*
- * ISC and SCO are only defined for X11 since they are there for
+ * ISC is only defined for X11 since it is there for
* backwards binary compatability only.
*/
@@ -252,6 +251,8 @@ static void _dummy(int sig)
#if defined(XIM_t)
#define PTSNODENAME "/dev/X/XIM."
#define NAMEDNODENAME "/dev/X/NXIM."
+#define SCORNODENAME "/dev/XIM.%sR"
+#define SCOSNODENAME "/dev/XIM.%sS"
#endif
#if defined(FS_t) || defined (FONT_t)
/*
@@ -260,14 +261,20 @@ static void _dummy(int sig)
*/
#define PTSNODENAME "/dev/X/fontserver."
#define NAMEDNODENAME "/dev/X/Nfontserver."
+#define SCORNODENAME "/dev/fontserver.%sR"
+#define SCOSNODENAME "/dev/fontserver.%sS"
#endif
#if defined(ICE_t)
#define PTSNODENAME "/dev/X/ICE."
#define NAMEDNODENAME "/dev/X/NICE."
+#define SCORNODENAME "/dev/ICE.%sR"
+#define SCOSNODENAME "/dev/ICE.%sS"
#endif
#if defined(TEST_t)
#define PTSNODENAME "/dev/X/transtest."
#define NAMEDNODENAME "/dev/X/Ntranstest."
+#define SCORNODENAME "/dev/transtest.%sR"
+#define SCOSNODENAME "/dev/transtest.%sS"
#endif
@@ -389,8 +396,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
if (ret != 1) {
PRMSG(1,
- "PTSOpenClient: failed to get acknoledgement from server\n",
- 0,0,0);
+ "PTSOpenClient: failed to get acknoledgement from server\n", 0,0,0);
(void) close(fd);
fd = -1;
}
@@ -401,8 +407,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, slave, server_path) == 0)
{
- PRMSG(1,"PTSOpenClient: failed to fill in addr info\n",
- 0,0,0);
+ PRMSG(1,"PTSOpenClient: failed to fill in addr info\n", 0,0,0);
close(fd);
return -1;
}
@@ -512,8 +517,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"PTSOpenServer: failed to fill in addr info\n",
- 0,0,0);
+ PRMSG(1,"PTSOpenServer: failed to fill in addr info\n", 0,0,0);
close(fd);
return -1;
}
@@ -837,11 +841,8 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
#ifndef sun
-/* SCO doesnt use the ISC transport type - it causes problems */
-#ifndef SCO325
-
/*
- * connect_spipe is used by the ISC connection type.
+ * connect_spipe is used by the SCO and ISC connection type.
*/
static int
connect_spipe(int fd1, int fd2)
@@ -866,7 +867,7 @@ connect_spipe(int fd1, int fd2)
}
/*
- * named_spipe is used by ISC connection type.
+ * named_spipe is used by the SCO and ISC connection type.
*/
static int
@@ -892,6 +893,9 @@ named_spipe(int fd, char *path)
return(ret);
}
+/* SCO doesnt use the ISC transport type - it causes problems */
+#if !defined(__SCO__) && !defined(__UNIXWARE__)
+
/* ISC */
@@ -996,8 +1000,7 @@ TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"ISCOpenClient: failed to fill in addr info\n",
- 0,0,0);
+ PRMSG(1,"ISCOpenClient: failed to fill in addr info\n", 0,0,0);
close(fd);
return -1;
}
@@ -1176,18 +1179,24 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
}
#endif /* TRANS_SERVER */
-#endif /* !SCO325 */
+#endif /* !__SCO__ && !__UNIXWARE__ */
/* SCO */
/*
- * 2002-11-09 (jkj@sco.com)
+ * 2002-11-09 (kean.johnston@x.org)
*
* 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
@@ -1206,9 +1215,11 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
#endif
PRMSG(2,"SCOOpenClient(%s)\n", port, 0,0 );
+ if (!port || !port[0])
+ port = "0";
#if !defined(SCORNODENAME)
- PRMSG(1,"SCOOpenClient: Protocol is not supported by a SCO connection\n", 0,0,0);
+ PRMSG(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n", 0,0,0);
return -1;
#else
(void) sprintf(server_path, SCORNODENAME, port);
@@ -1258,11 +1269,12 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
* 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",
- 0,0,0);
+ PRMSG(1,"SCOOpenClient: failed to fill addr info\n", 0,0,0);
close(fd);
return -1;
}
@@ -1286,22 +1298,47 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
struct flock mylock;
int fdr = -1;
int fds = -1;
- long temp;
- struct strfdinsert sbuf;
#endif
PRMSG(2,"SCOOpenServer(%s)\n", port, 0,0 );
+ if (!port || !port[0])
+ port = "0";
#if !defined(SCORNODENAME)
- PRMSG(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+ PRMSG(2,"SCOOpenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
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, 0,0 );
+ return -1;
+ }
+
+ if (named_spipe (fds, serverS_path) == -1) {
+ PRMSG(1,"SCOOpenServer: failed to create %s\n", serverS_path, 0, 0);
+ close (fdr);
+ close (fds);
+ return -1;
+ }
+
+ if (named_spipe (fdr, serverR_path) == -1) {
+ PRMSG(1,"SCOOpenServer: failed to create %s\n", serverR_path, 0, 0);
+ 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", serverS_path, 0, 0);
+ PRMSG(1,"SCOOpenServer: failed to open %s\n", serverS_path, 0, 0);
return -1;
}
@@ -1314,30 +1351,22 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
mylock.l_start = 0;
mylock.l_len = 0;
if (fcntl (fds, F_SETLK, &mylock) < 0) {
- PRMSG(1,"SCOOpenServer: failed to lock %s", serverS_path, 0, 0);
+ PRMSG(1,"SCOOpenServer: failed to lock %s\n", serverS_path, 0, 0);
close (fds);
return -1;
}
fdr = open (serverR_path, O_RDWR | O_NDELAY);
if (fds < 0) {
- PRMSG(1,"SCOOpenServer: failed to open %s", serverR_path, 0, 0);
+ PRMSG(1,"SCOOpenServer: failed to open %s\n", serverR_path, 0, 0);
close (fds);
return -1;
}
+#endif /* X11_t */
- sbuf.databuf.maxlen = 0;
- 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.flags = 0;
- sbuf.fildes = fdr;
-
- if (ioctl(fds, I_FDINSERT, &sbuf) < 0) {
- PRMSG(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s", serverS_path, 0, 0);
+ if (connect_spipe(fds, fdr)) {
+ PRMSG(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n",
+ serverS_path, 0, 0);
close (fdr);
close (fds);
return -1;
@@ -1347,7 +1376,9 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
* 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", 0,0,0);
close(fds);
@@ -1365,35 +1396,23 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
{
char c;
int fd;
- long temp;
- struct strfdinsert sbuf;
PRMSG(2,"SCOAccept(%d)\n", ciptr->fd, 0,0 );
if (read(ciptr->fd, &c, 1) < 0) {
- PRMSG(1,"SCOAccept: can't read from client",0,0,0);
+ PRMSG(1,"SCOAccept: can't read from client\n",0,0,0);
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
if( (fd = open(DEV_SPX, O_RDWR)) < 0 ) {
- PRMSG(1,"SCOAccept: can't open \"%s\"",DEV_SPX, 0,0 );
+ PRMSG(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX, 0,0 );
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
- sbuf.databuf.maxlen = 0;
- 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.flags = 0;
- sbuf.fildes = fd;
-
- if (ioctl(ciptr->fd, I_FDINSERT, &sbuf) < 0) {
- PRMSG(1,"SCOAccept: ioctl(I_FDINSERT) failed", 0, 0, 0);
+ if (connect_spipe (ciptr->fd, fd) < 0) {
+ PRMSG(1,"SCOAccept: ioctl(I_FDINSERT) failed\n", 0, 0, 0);
close (fd);
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -1414,7 +1433,9 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
}
memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen);
+#if defined(__SCO__)
newciptr->flags |= TRANS_NOUNLINK;
+#endif
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
@@ -1517,7 +1538,7 @@ TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd, char *port)
}
#ifndef sun
-#ifndef SCO325
+#if !defined(__SCO__) && !defined(__UNIXWARE__)
static int
TRANS(ISCReopenServer)(XtransConnInfo ciptr, int fd, char *port)
@@ -1545,7 +1566,7 @@ TRANS(ISCReopenServer)(XtransConnInfo ciptr, int fd, char *port)
#endif /* !ISCDEVNODENAME */
}
-#endif /* !SCO325 */
+#endif /* !__SCO__ && !__UNIXWARE__ */
static int
TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
@@ -1556,15 +1577,19 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
#endif
PRMSG(2,"SCOReopenServer(%s)\n", port, 0,0 );
+ if (!port || !port[0])
+ port = "0";
#if !defined(SCORNODENAME)
- PRMSG(1,"SCOReopenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+ PRMSG(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
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", 0,0,0);
@@ -1786,7 +1811,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
#endif /* SVR4 */
#ifndef sun
-#ifndef SCO325
+#if !defined(__SCO__) && !defined(__UNIXWARE__)
{"isc",
#ifdef TRANS_CLIENT
TRANS(ISCOpenClient),
@@ -1808,7 +1833,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
TRANS(ISCAccept)
#endif /* TRANS_SERVER */
},
-#endif /* !SCO325 */
+#endif /* !__SCO__ && !__UNIXWARE__ */
{"sco",
#ifdef TRANS_CLIENT
@@ -1840,8 +1865,10 @@ static char *XLOCAL=NULL;
static char *workingXLOCAL=NULL;
static char *freeXLOCAL=NULL;
-#ifdef SCO325
+#if defined(__SCO__)
#define DEF_XLOCAL "SCO:UNIX:PTS"
+#elif defined(__UNIXWARE__)
+#define DEF_XLOCAL "UNIX:PTS:NAMED:SCO"
#else
#define DEF_XLOCAL "UNIX:PTS:NAMED:ISC:SCO"
#endif
@@ -2391,7 +2418,7 @@ TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend )
{
PRMSG(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend);
-#if defined(ISC) || defined(SCO)
+#if defined(ISC) || defined(SCO325)
return ioctl(ciptr->fd, I_NREAD, (char *)pend);
#else
return ioctl(ciptr->fd, FIONREAD, (char *)pend);
@@ -2502,7 +2529,7 @@ static char * local_aliases[] = {
# endif
"named",
# ifndef sun
-# ifndef SCO325
+# if !defined(__SCO__) && !defined(__UNIXWARE__)
"isc",
# endif
"sco",
@@ -2635,7 +2662,7 @@ Xtransport TRANS(NAMEDFuncs) = {
};
#ifndef sun
-#ifndef SCO325
+#if !defined(__SCO__) && !defined(__UNIXWARE__)
Xtransport TRANS(ISCFuncs) = {
/* Local Interface */
"isc",
@@ -2675,7 +2702,7 @@ Xtransport TRANS(ISCFuncs) = {
TRANS(LocalClose),
TRANS(LocalCloseForCloning),
};
-#endif /* !SCO325 */
+#endif /* !__SCO__ && !__UNIXWARE__ */
Xtransport TRANS(SCOFuncs) = {
/* Local Interface */
"sco",
diff --git a/Xtranssock.c b/Xtranssock.c
index 25b35eb..794d29b 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -99,11 +99,11 @@ from the copyright holders.
#endif /* !NO_TCP_H */
#include <sys/ioctl.h>
-#if defined(SVR4) && !defined(SCO325) && !defined(DGUX) && !defined(_SEQUENT_)
+#if defined(SVR4) && !defined(DGUX) && !defined(_SEQUENT_)
#include <sys/filio.h>
#endif
-#if (defined(i386) && defined(SYSV)) && !defined(sco) && !defined(sun)
+#if (defined(i386) && defined(SYSV)) && !defined(SCO325) && !defined(sun)
#include <net/errno.h>
#endif
@@ -326,7 +326,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
#endif
struct sockaddr_in socknamev4;
void *socknamePtr;
-#if defined(SVR4) || defined(SCO325)
+#if defined(SVR4) || defined(__SCO__)
size_t namelen;
#else
int namelen;
@@ -401,7 +401,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
#endif
struct sockaddr_in socknamev4;
void *socknamePtr;
-#if defined(SVR4) || defined(SCO325)
+#if defined(SVR4) || defined(__SCO__)
size_t namelen;
#else
int namelen;
@@ -1099,7 +1099,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
sprintf (sockname.sun_path, "%s%ld", UNIX_PATH, (long)getpid());
}
-#if defined(BSD44SOCKETS) && !defined(Lynx)
+#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx)
sockname.sun_len = strlen(sockname.sun_path);
namelen = SUN_LEN(&sockname);
#else
@@ -1163,7 +1163,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
if (stat (unsock->sun_path, &statb) == -1 ||
((statb.st_mode & S_IFMT) !=
-#if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO) || defined(sco) || !defined(S_IFSOCK)
+#if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO325) || !defined(S_IFSOCK)
S_IFIFO))
#else
S_IFSOCK))
@@ -1308,7 +1308,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
{
XtransConnInfo newciptr;
struct sockaddr_un sockname;
-#if defined(SVR4) || defined(SCO325)
+#if defined(SVR4) || defined(__SCO__)
size_t namelen = sizeof sockname;
#else
int namelen = sizeof sockname;
@@ -1985,7 +1985,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
return TRANS_CONNECT_FAILED;
}
-#if defined(BSD44SOCKETS) && !defined(Lynx)
+#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx)
sockname.sun_len = strlen (sockname.sun_path);
namelen = SUN_LEN (&sockname);
#else
@@ -2101,7 +2101,7 @@ TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend)
return ret;
}
#else
-#if (defined(i386) && defined(SYSV) && !defined(sco)) || (defined(_SEQUENT_) && _SOCKET_VERSION == 1)
+#if (defined(i386) && defined(SYSV) && !defined(SCO325)) || (defined(_SEQUENT_) && _SOCKET_VERSION == 1)
return ioctl (ciptr->fd, I_NREAD, (char *) pend);
#else
#if defined(__UNIXOS2__)
diff --git a/Xtransutil.c b/Xtransutil.c
index cd22b68..7ae4e29 100644
--- a/Xtransutil.c
+++ b/Xtransutil.c
@@ -192,6 +192,14 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
}
#endif /* defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)*/
+#if (defined(__SCO__) || defined(__UNIXWARE__)) && defined(LOCALCONN)
+ case 0:
+ {
+ *familyp=FamilyLocal;
+ break;
+ }
+#endif
+
default:
PRMSG(1,"ConvertAddress: Unknown family type %d\n",