summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xtrans.c10
-rw-r--r--Xtransint.h6
-rw-r--r--Xtranslcl.c158
-rw-r--r--Xtranssock.c18
-rw-r--r--Xtransutil.c7
5 files changed, 116 insertions, 83 deletions
diff --git a/Xtrans.c b/Xtrans.c
index 4c8cb14..056804f 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 dad0d8a..43d6da8 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 5d73e65..8aa583f 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
@@ -244,7 +243,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 they are there for
* backwards binary compatability only.
*/
@@ -257,6 +256,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)
/*
@@ -265,14 +266,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
@@ -394,8 +401,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;
}
@@ -406,8 +412,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;
}
@@ -517,8 +522,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;
}
@@ -842,11 +846,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 types.
*/
static int
connect_spipe(int fd1, int fd2)
@@ -871,7 +872,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 types.
*/
static int
@@ -897,6 +898,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 */
@@ -1001,8 +1005,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;
}
@@ -1119,8 +1122,7 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"ISCOpenServer: failed to fill in addr info\n",
- 0,0,0);
+ PRMSG(1,"ISCOpenServer: failed to fill in addr info\n", 0, 0, 0);
close(fd);
return -1;
}
@@ -1181,7 +1183,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
}
#endif /* TRANS_SERVER */
-#endif /* !SCO325 */
+#endif /* !__SCO__ && !__UNIXWARE__ */
/* SCO */
@@ -1193,6 +1195,12 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
* 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
@@ -1211,9 +1219,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);
@@ -1263,11 +1273,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;
}
@@ -1291,11 +1302,11 @@ 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);
@@ -1304,9 +1315,34 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
(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;
}
@@ -1319,30 +1355,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;
@@ -1352,7 +1380,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);
@@ -1370,35 +1400,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;
@@ -1419,7 +1437,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 ) {
@@ -1522,7 +1542,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)
@@ -1550,7 +1570,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)
@@ -1561,15 +1581,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);
@@ -1791,7 +1815,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
#endif /* SVR4 */
#ifndef sun
-#ifndef SCO325
+#if !defined(__SCO__) && !defined(__UNIXWARE__)
{"isc",
#ifdef TRANS_CLIENT
TRANS(ISCOpenClient),
@@ -1813,7 +1837,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
TRANS(ISCAccept)
#endif /* TRANS_SERVER */
},
-#endif /* !SCO325 */
+#endif /* !__SCO__ && !__UNIXWARE__ */
{"sco",
#ifdef TRANS_CLIENT
@@ -1845,8 +1869,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
@@ -2396,7 +2422,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);
@@ -2504,7 +2530,7 @@ static char * local_aliases[] = {
# endif
"named",
# ifndef sun
-# ifndef SCO325
+# if !defined(__SCO__) && !defined(__UNIXWARE__)
"isc",
# endif
"sco",
@@ -2637,7 +2663,7 @@ Xtransport TRANS(NAMEDFuncs) = {
};
#ifndef sun
-#ifndef SCO325
+#if !defined(__SCO__) && !defined(__UNIXWARE__)
Xtransport TRANS(ISCFuncs) = {
/* Local Interface */
"isc",
@@ -2677,7 +2703,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 81db6aa..e79528b 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
@@ -330,7 +330,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;
@@ -405,7 +405,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;
@@ -1103,7 +1103,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
@@ -1167,7 +1167,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))
@@ -1312,7 +1312,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;
@@ -1993,7 +1993,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
@@ -2109,7 +2109,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 f6818af..253e8b0 100644
--- a/Xtransutil.c
+++ b/Xtransutil.c
@@ -192,6 +192,13 @@ 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",