summaryrefslogtreecommitdiff
path: root/Xtranslcl.c
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-08-19 23:53:22 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-08-19 23:53:22 +0000
commit4683f28f0c9d1a1ee0338a32011219ed1fb3c565 (patch)
tree3e616a3e3f2ce8806785b0a0844e258eb1d8fc24 /Xtranslcl.c
parent79db37c65905823b66411533152ab54407f04004 (diff)
downloadxorg-lib-libxtrans-4683f28f0c9d1a1ee0338a32011219ed1fb3c565.tar.gz
Bugzilla #3957 <https://bugs.freedesktop.org/show_bug.cgi?id=3957> Patch
#2924 <https://bugs.freedesktop.org/attachment.cgi?id=2924> xtrans changes for AIX (Dan McNichol, IBM) Bugzilla #3957 <https://bugs.freedesktop.org/show_bug.cgi?id=3957> Patch #2925 <https://bugs.freedesktop.org/attachment.cgi?id=2925> xtrans changes for AIX (Dan McNichol, IBM)
Diffstat (limited to 'Xtranslcl.c')
-rw-r--r--Xtranslcl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Xtranslcl.c b/Xtranslcl.c
index fd68289..5d73e65 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -227,7 +227,12 @@ static void _dummy(int sig)
#define X_STREAMS_DIR "/tmp/.X11-pipe"
#endif
#endif
+
+#ifdef _AIX
+#define DEV_PTMX "/dev/ptc"
+#else
#define DEV_PTMX "/dev/ptmx"
+#endif
#if defined(X11_t)
@@ -319,9 +324,9 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
* Open the streams based pipe that will be this connection.
*/
- if ((fd = open("/dev/ptmx", O_RDWR)) < 0) {
- PRMSG(1,"PTSOpenClient: failed to open /dev/ptmx\n", 0,0,0);
- return -1;
+ if ((fd = open(DEV_PTMX, O_RDWR)) < 0) {
+ PRMSG(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX, 0,0);
+ return(-1);
}
(void) grantpt(fd);
@@ -2448,7 +2453,6 @@ TRANS(LocalClose)(XtransConnInfo ciptr)
{
struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr;
- char path[200]; /* > sizeof sun_path +1 */
int ret;
PRMSG(2,"LocalClose(%x->%d)\n", ciptr, ciptr->fd ,0);
@@ -2460,10 +2464,8 @@ TRANS(LocalClose)(XtransConnInfo ciptr)
&& sockname->sun_family == AF_UNIX
&& sockname->sun_path[0] )
{
- strncpy(path,sockname->sun_path,
- ciptr->addrlen-sizeof(sockname->sun_family));
if (!(ciptr->flags & TRANS_NOUNLINK))
- unlink(path);
+ unlink(sockname->sun_path);
}
return ret;