Skip to content

Commit 2d06f61

Browse files
committed
Fix unused-variable warning on Windows.
Introduced in 585bca3: msgid is not used in the Windows code path. Also adjust comments a tad (mostly to keep pgindent from messing it up). David Rowley
1 parent df2e626 commit 2d06f61

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,11 +2610,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
26102610
int port = LDAP_DEF_PORT,
26112611
scope,
26122612
rc,
2613-
msgid,
26142613
size,
26152614
state,
26162615
oldstate,
26172616
i;
2617+
#ifndef WIN32
2618+
int msgid;
2619+
#endif
26182620
bool found_keyword;
26192621
char *url,
26202622
*hostname,
@@ -2759,11 +2761,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
27592761

27602762
/*
27612763
* Perform an explicit anonymous bind.
2762-
* LDAP does not require that an anonymous bind is preformed explicitly,
2764+
*
2765+
* LDAP does not require that an anonymous bind is performed explicitly,
27632766
* but we want to distinguish between the case where LDAP bind does not
27642767
* succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
27652768
* the service control file) and the case where querying the LDAP server
27662769
* fails (return 1 to end parsing).
2770+
*
27672771
* Unfortunately there is no way of setting a timeout that works for
27682772
* both Windows and OpenLDAP.
27692773
*/
@@ -2776,7 +2780,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
27762780
ldap_unbind(ld);
27772781
return 2;
27782782
}
2779-
#else /* WIN32 */
2783+
#else /* !WIN32 */
27802784
/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
27812785
if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &time) != LDAP_SUCCESS)
27822786
{
@@ -3031,7 +3035,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
30313035

30323036
return 0;
30333037
}
3034-
#endif
3038+
3039+
#endif /* USE_LDAP */
30353040

30363041
#define MAXBUFSIZE 256
30373042

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy