Skip to content

Commit 98876f0

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 fc72e94 commit 98876f0

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
@@ -3378,11 +3378,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
33783378
int port = LDAP_DEF_PORT,
33793379
scope,
33803380
rc,
3381-
msgid,
33823381
size,
33833382
state,
33843383
oldstate,
33853384
i;
3385+
#ifndef WIN32
3386+
int msgid;
3387+
#endif
33863388
bool found_keyword;
33873389
char *url,
33883390
*hostname,
@@ -3527,11 +3529,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35273529

35283530
/*
35293531
* Perform an explicit anonymous bind.
3530-
* LDAP does not require that an anonymous bind is preformed explicitly,
3532+
*
3533+
* LDAP does not require that an anonymous bind is performed explicitly,
35313534
* but we want to distinguish between the case where LDAP bind does not
35323535
* succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
35333536
* the service control file) and the case where querying the LDAP server
35343537
* fails (return 1 to end parsing).
3538+
*
35353539
* Unfortunately there is no way of setting a timeout that works for
35363540
* both Windows and OpenLDAP.
35373541
*/
@@ -3544,7 +3548,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35443548
ldap_unbind(ld);
35453549
return 2;
35463550
}
3547-
#else /* WIN32 */
3551+
#else /* !WIN32 */
35483552
/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
35493553
if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &time) != LDAP_SUCCESS)
35503554
{
@@ -3799,7 +3803,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
37993803

38003804
return 0;
38013805
}
3802-
#endif
3806+
3807+
#endif /* USE_LDAP */
38033808

38043809
#define MAXBUFSIZE 256
38053810

0 commit comments

Comments
 (0)