aboutsummaryrefslogtreecommitdiff
path: root/X11/xtrans/Xtranssock.c
diff options
context:
space:
mode:
Diffstat (limited to 'X11/xtrans/Xtranssock.c')
-rw-r--r--X11/xtrans/Xtranssock.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/X11/xtrans/Xtranssock.c b/X11/xtrans/Xtranssock.c
index 1d11ab011..128bd4a94 100644
--- a/X11/xtrans/Xtranssock.c
+++ b/X11/xtrans/Xtranssock.c
@@ -87,7 +87,7 @@ from the copyright holders.
#endif /* !NO_TCP_H */
#include <sys/ioctl.h>
-#if defined(SVR4)
+#if defined(SVR4) || defined(__SVR4)
#include <sys/filio.h>
#endif
@@ -226,7 +226,7 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr);
#else
# define SOCKLEN_T socklen_t
#endif
-#elif defined(SVR4) || defined(__SCO__)
+#elif defined(SVR4) || defined(__SVR4) || defined(__SCO__)
# define SOCKLEN_T size_t
#else
# define SOCKLEN_T int
@@ -532,7 +532,14 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
ciptr->family = AF_UNIX;
memcpy(ciptr->peeraddr, ciptr->addr, sizeof(struct sockaddr));
ciptr->port = rindex(addr->sa_data, ':');
- if (ciptr->port[0] == ':') ciptr->port++; /* port should now point to portnum or NULL */
+ if (ciptr->port == NULL) {
+ if (is_numeric(addr->sa_data)) {
+ ciptr->port = addr->sa_data;
+ }
+ } else if (ciptr->port[0] == ':') {
+ ciptr->port++;
+ }
+ /* port should now point to portnum or NULL */
return ciptr;
}
@@ -559,8 +566,12 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
while ((i = TRANS(SocketSelectFamily) (i, transname)) >= 0) {
if ((ciptr = TRANS(SocketOpen) (
- i, Sockettrans2devtab[i].devcotsname)) != NULL)
+ i, Sockettrans2devtab[i].devcotsname)) != NULL) {
+ /* Save the index for later use */
+
+ ciptr->index = i;
break;
+ }
}
if (i < 0) {
if (i == -1)
@@ -572,10 +583,6 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
return NULL;
}
- /* Save the index for later use */
-
- ciptr->index = i;
-
return ciptr;
}
@@ -1191,7 +1198,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
if (!abstract && (
stat (unsock->sun_path, &statb) == -1 ||
((statb.st_mode & S_IFMT) !=
-#if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO325) || !defined(S_IFSOCK)
+#if defined(NCR) || defined(SCO325) || !defined(S_IFSOCK)
S_IFIFO
#else
S_IFSOCK