diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-12-11 09:45:47 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-12-11 09:45:47 +0100 |
commit | 29bb123124ae92c10baf49204da36184e05ae232 (patch) | |
tree | 751e5beaf2176c2b86953c1226bd33ecbd4aeb76 /nx-X11 | |
parent | 4988e7c5f2ad60c223077ffe83a28b5122c688fd (diff) | |
parent | 0eb1dc67d363032e76076aa4d01cf0615f8eb092 (diff) | |
download | nx-libs-29bb123124ae92c10baf49204da36184e05ae232.tar.gz nx-libs-29bb123124ae92c10baf49204da36184e05ae232.tar.bz2 nx-libs-29bb123124ae92c10baf49204da36184e05ae232.zip |
Merge branch 'uli42-pr/simplify_xtrans' into 3.6.x
Attributes GH PR #595: https://github.com/ArcticaProject/nx-libs/pull/595
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/lib/include/xtrans/Xtranssock.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/nx-X11/lib/include/xtrans/Xtranssock.c b/nx-X11/lib/include/xtrans/Xtranssock.c index f59c336dc..a7470edcd 100644 --- a/nx-X11/lib/include/xtrans/Xtranssock.c +++ b/nx-X11/lib/include/xtrans/Xtranssock.c @@ -2874,48 +2874,7 @@ TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size) { return NXTransWriteVector(ciptr->fd, buf, size); } - else - { - /* FIXME: same code as below, should be possible without duplication */ -#if XTRANS_SEND_FDS - if (ciptr->send_fds) - { - union fd_pass cmsgbuf; - int nfd = nFd(&ciptr->send_fds); - struct _XtransConnFd *cf = ciptr->send_fds; - struct msghdr msg = { - .msg_name = NULL, - .msg_namelen = 0, - .msg_iov = buf, - .msg_iovlen = size, - .msg_control = cmsgbuf.buf, - .msg_controllen = CMSG_LEN(nfd * sizeof(int)) - }; - struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); - int i; - int *fds; - - hdr->cmsg_len = msg.msg_controllen; - hdr->cmsg_level = SOL_SOCKET; - hdr->cmsg_type = SCM_RIGHTS; - - fds = (int *) CMSG_DATA(hdr); - /* Set up fds */ - for (i = 0; i < nfd; i++) { - fds[i] = cf->fd; - cf = cf->next; - } - - i = sendmsg(ciptr->fd, &msg, 0); - if (i > 0) - discardFd(&ciptr->send_fds, cf, 0); - return i; - } #endif - return WRITEV (ciptr, buf, size); - } - -#else /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ #if XTRANS_SEND_FDS if (ciptr->send_fds) @@ -2953,11 +2912,8 @@ TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size) } #endif return WRITEV (ciptr, buf, size); - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ } - static int TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size) |