From 6b54b5cf8086f127aa87096e2bdd2263d1c81683 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 7 Nov 2013 03:49:05 -0800 Subject: Actually disable all of the FD passing code unless XTRANS_SEND_FDS is set Stick all of the functions relating to FD passing inside Signed-off-by: Keith Packard --- Xtrans.c | 2 ++ Xtransint.h | 2 ++ Xtranssock.c | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/Xtrans.c b/Xtrans.c index be9a057..735d7b8 100644 --- a/Xtrans.c +++ b/Xtrans.c @@ -879,6 +879,7 @@ TRANS(Writev) (XtransConnInfo ciptr, struct iovec *buf, int size) return ciptr->transptr->Writev (ciptr, buf, size); } +#if XTRANS_SEND_FDS int TRANS(SendFd) (XtransConnInfo ciptr, int fd, int do_close) { @@ -890,6 +891,7 @@ TRANS(RecvFd) (XtransConnInfo ciptr) { return ciptr->transptr->RecvFd(ciptr); } +#endif int TRANS(Disconnect) (XtransConnInfo ciptr) diff --git a/Xtransint.h b/Xtransint.h index 581af9f..8dee614 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -291,6 +291,7 @@ typedef struct _Xtransport { int /* size */ ); +#if XTRANS_SEND_FDS int (*SendFd)( XtransConnInfo, /* connection */ int, /* fd */ @@ -300,6 +301,7 @@ typedef struct _Xtransport { int (*RecvFd)( XtransConnInfo /* connection */ ); +#endif int (*Disconnect)( XtransConnInfo /* connection */ diff --git a/Xtranssock.c b/Xtranssock.c index 84e4dcd..c96f45b 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -2506,8 +2506,10 @@ Xtransport TRANS(SocketTCPFuncs) = { TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), +#if XTRANS_SEND_FDS TRANS(SocketSendFdInvalid), TRANS(SocketRecvFdInvalid), +#endif TRANS(SocketDisconnect), TRANS(SocketINETClose), TRANS(SocketINETClose), @@ -2548,8 +2550,10 @@ Xtransport TRANS(SocketINETFuncs) = { TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), +#if XTRANS_SEND_FDS TRANS(SocketSendFdInvalid), TRANS(SocketRecvFdInvalid), +#endif TRANS(SocketDisconnect), TRANS(SocketINETClose), TRANS(SocketINETClose), @@ -2591,8 +2595,10 @@ Xtransport TRANS(SocketINET6Funcs) = { TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), +#if XTRANS_SEND_FDS TRANS(SocketSendFdInvalid), TRANS(SocketRecvFdInvalid), +#endif TRANS(SocketDisconnect), TRANS(SocketINETClose), TRANS(SocketINETClose), @@ -2641,8 +2647,10 @@ Xtransport TRANS(SocketLocalFuncs) = { TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), +#if XTRANS_SEND_FDS TRANS(SocketSendFd), TRANS(SocketRecvFd), +#endif TRANS(SocketDisconnect), TRANS(SocketUNIXClose), TRANS(SocketUNIXCloseForCloning), @@ -2697,8 +2705,10 @@ Xtransport TRANS(SocketUNIXFuncs) = { TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), +#if XTRANS_SEND_FDS TRANS(SocketSendFd), TRANS(SocketRecvFd), +#endif TRANS(SocketDisconnect), TRANS(SocketUNIXClose), TRANS(SocketUNIXCloseForCloning), -- cgit v1.2.3