summaryrefslogtreecommitdiff
path: root/Xtranssock.c
diff options
context:
space:
mode:
authorBen Byer <bbyer@bbyer.local>2007-11-14 03:57:57 -0800
committerBen Byer <bbyer@bbyer.local>2007-11-14 03:57:57 -0800
commitcd1da5cec49fb7fe6238a00d9ba550b3ed78fa08 (patch)
treee2499cfea692114c909b0af69838a4b04dbc3312 /Xtranssock.c
parent3da4d6c1dc05f9e1291b023a97535eb67f0830e2 (diff)
Fix for incorrect processing of recycled launchd socket on OS X
Diffstat (limited to 'Xtranssock.c')
-rw-r--r--Xtranssock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Xtranssock.c b/Xtranssock.c
index 8b18f09..b7a601b 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -535,7 +535,7 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
return NULL;
}
- portlen = strlen(port);
+ portlen = strlen(port) + 1; // include space for trailing null
#ifdef BSD44SOCKETS
if (portlen < 0 || portlen > (SOCK_MAXADDRLEN + 2)) {
PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen, 0, 0);
@@ -572,7 +572,7 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
ciptr->peeraddrlen = portlen + 2;
/* Initialize ciptr structure as if it were a normally-opened unix socket */
- ciptr->flags = TRANS_LOCAL;
+ ciptr->flags = TRANS_LOCAL | TRANS_NOUNLINK;
#ifdef BSD44SOCKETS
addr->sa_len = portlen + 1;
#endif