summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-07 03:49:05 -0800
committerKeith Packard <keithp@keithp.com>2013-11-07 03:49:05 -0800
commit6b54b5cf8086f127aa87096e2bdd2263d1c81683 (patch)
treee52217bdef7d2ec21a7409002e504f2ec84a9384
parentf3709f3e0b883a0b4956313f89fa931e9264c346 (diff)
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 <keithp@keithp.com>
-rw-r--r--Xtrans.c2
-rw-r--r--Xtransint.h2
-rw-r--r--Xtranssock.c10
3 files changed, 14 insertions, 0 deletions
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),