aboutsummaryrefslogtreecommitdiff
path: root/X11/xtrans/Xtranssock.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-02 21:09:13 +0000
committermarha <marha@users.sourceforge.net>2009-09-02 21:09:13 +0000
commit8fedf58693f42869528b41408ac4d6012839e973 (patch)
tree62a817bea7dfc71050292d302ba94f5e349c67a7 /X11/xtrans/Xtranssock.c
parentac14083f465166b298162a57fff0bad90e528fff (diff)
parent6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff)
downloadvcxsrv-8fedf58693f42869528b41408ac4d6012839e973.tar.gz
vcxsrv-8fedf58693f42869528b41408ac4d6012839e973.tar.bz2
vcxsrv-8fedf58693f42869528b41408ac4d6012839e973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
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