From: Tom Lane Date: Thu, 17 Apr 2014 20:12:24 +0000 (-0400) Subject: Fix unused-variable warning on Windows. X-Git-Tag: REL9_0_18~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=757ade42d0ea1a3542115dc873805f8027800a16;p=thirdparty%2Fpostgresql.git 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 --- diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 58963ff0458..e39cb3ed00d 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -3134,11 +3134,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, @@ -3283,11 +3285,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. */ @@ -3300,7 +3304,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) { @@ -3555,7 +3559,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, return 0; } -#endif + +#endif /* USE_LDAP */ #define MAXBUFSIZE 256