From 63bef223359b465a70db0c035d0fd73388c4715d Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Sat, 31 Mar 2007 00:40:22 +0000
Subject: [PATCH] Cleanup conditional arg in prev commit

---
 servers/slapd/connection.c | 10 ++--------
 servers/slapd/daemon.c     | 10 ++--------
 servers/slapd/proto-slap.h | 10 ++++++----
 3 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c
index 41bca5cb84..e4e2c9e28c 100644
--- a/servers/slapd/connection.c
+++ b/servers/slapd/connection.c
@@ -367,10 +367,7 @@ Connection * connection_init(
 	int flags,
 	slap_ssf_t ssf,
 	struct berval *authid
-#ifdef LDAP_PF_LOCAL_SENDMSG
-	, struct berval *peerbv
-#endif
-)
+	LDAP_PF_LOCAL_SENDMSG_ARG(struct berval *peerbv))
 {
 	unsigned long id;
 	Connection *c;
@@ -1208,10 +1205,7 @@ int connection_client_setup(
 
 	c = connection_init( s, (Listener *)&dummy_list, "", "",
 		CONN_IS_CLIENT, 0, NULL
-#ifdef LDAP_PF_LOCAL_SENDMSG
-		, NULL
-#endif
-		);
+		LDAP_PF_LOCAL_SENDMSG_ARG(NULL));
 	if ( !c ) return -1;
 
 	c->c_clientfunc = func;
diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c
index 59986a6009..704a138772 100644
--- a/servers/slapd/daemon.c
+++ b/servers/slapd/daemon.c
@@ -1829,10 +1829,7 @@ slap_listener(
 		dnsname != NULL ? dnsname : SLAP_STRING_UNKNOWN,
 		peername, cflag, ssf,
 		authid.bv_val ? &authid : NULL
-#ifdef LDAP_PF_LOCAL_SENDMSG
-		, &peerbv
-#endif
-	);
+		LDAP_PF_LOCAL_SENDMSG_ARG(&peerbv));
 
 	if( authid.bv_val ) ch_free(authid.bv_val);
 
@@ -2538,10 +2535,7 @@ connectionless_init( void )
 
 		c = connection_init( lr->sl_sd, lr, "", "",
 			CONN_IS_UDP, (slap_ssf_t) 0, NULL
-#ifdef LDAP_PF_LOCAL_SENDMSG
-			, NULL
-#endif
-			);
+			LDAP_PF_LOCAL_SENDMSG_ARG(NULL));
 
 		if ( !c ) {
 			Debug( LDAP_DEBUG_TRACE,
diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h
index f5cc8eb164..e811ed3220 100644
--- a/servers/slapd/proto-slap.h
+++ b/servers/slapd/proto-slap.h
@@ -685,6 +685,11 @@ LDAP_SLAPD_F (int) connection_client_setup LDAP_P((
 LDAP_SLAPD_F (void) connection_client_enable LDAP_P(( ber_socket_t s ));
 LDAP_SLAPD_F (void) connection_client_stop LDAP_P(( ber_socket_t s ));
 
+#ifdef LDAP_PF_LOCAL_SENDMSG
+#define LDAP_PF_LOCAL_SENDMSG_ARG(arg)	, arg
+#else
+#define LDAP_PF_LOCAL_SENDMSG_ARG(arg)
+#endif
 
 LDAP_SLAPD_F (Connection *) connection_init LDAP_P((
 	ber_socket_t s,
@@ -694,10 +699,7 @@ LDAP_SLAPD_F (Connection *) connection_init LDAP_P((
 	int use_tls,
 	slap_ssf_t ssf,
 	struct berval *id
-#ifdef LDAP_PF_LOCAL_SENDMSG
-	, struct berval *peerbv
-#endif
-	));
+	LDAP_PF_LOCAL_SENDMSG_ARG(struct berval *peerbv)));
 
 LDAP_SLAPD_F (void) connection_closing LDAP_P((
 	Connection *c, const char *why ));