aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-04-17 16:12:24 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-04-17 16:12:38 -0400
commitc6b55bec3fb232c81ba4eba30856b222ad7a8cc4 (patch)
tree06f1e6b6c7730553604bc52e6f176f6724fded6a
parentea8725a8b376b46324b47616432670769cae95ed (diff)
downloadpostgresql-c6b55bec3fb232c81ba4eba30856b222ad7a8cc4.tar.gz
postgresql-c6b55bec3fb232c81ba4eba30856b222ad7a8cc4.zip
Fix unused-variable warning on Windows.
Introduced in 585bca39: msgid is not used in the Windows code path. Also adjust comments a tad (mostly to keep pgindent from messing it up). David Rowley
-rw-r--r--src/interfaces/libpq/fe-connect.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index e7ef28fb8f4..612d43472f8 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -3415,11 +3415,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
int port = LDAP_DEF_PORT,
scope,
rc,
- msgid,
size,
state,
oldstate,
i;
+#ifndef WIN32
+ int msgid;
+#endif
bool found_keyword;
char *url,
*hostname,
@@ -3564,11 +3566,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
/*
* Perform an explicit anonymous bind.
- * LDAP does not require that an anonymous bind is preformed explicitly,
+ *
+ * LDAP does not require that an anonymous bind is performed explicitly,
* but we want to distinguish between the case where LDAP bind does not
* succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
* the service control file) and the case where querying the LDAP server
* fails (return 1 to end parsing).
+ *
* Unfortunately there is no way of setting a timeout that works for
* both Windows and OpenLDAP.
*/
@@ -3581,7 +3585,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
ldap_unbind(ld);
return 2;
}
-#else /* WIN32 */
+#else /* !WIN32 */
/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &time) != LDAP_SUCCESS)
{
@@ -3836,7 +3840,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
return 0;
}
-#endif
+
+#endif /* USE_LDAP */
#define MAXBUFSIZE 256