Skip to content

Commit 7f81440

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 fc02b87 commit 7f81440

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
@@ -3365,11 +3365,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
33653365
int port = LDAP_DEF_PORT,
33663366
scope,
33673367
rc,
3368-
msgid,
33693368
size,
33703369
state,
33713370
oldstate,
33723371
i;
3372+
#ifndef WIN32
3373+
int msgid;
3374+
#endif
33733375
bool found_keyword;
33743376
char *url,
33753377
*hostname,
@@ -3514,11 +3516,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35143516

35153517
/*
35163518
* Perform an explicit anonymous bind.
3517-
* LDAP does not require that an anonymous bind is preformed explicitly,
3519+
*
3520+
* LDAP does not require that an anonymous bind is performed explicitly,
35183521
* but we want to distinguish between the case where LDAP bind does not
35193522
* succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
35203523
* the service control file) and the case where querying the LDAP server
35213524
* fails (return 1 to end parsing).
3525+
*
35223526
* Unfortunately there is no way of setting a timeout that works for
35233527
* both Windows and OpenLDAP.
35243528
*/
@@ -3531,7 +3535,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35313535
ldap_unbind(ld);
35323536
return 2;
35333537
}
3534-
#else /* WIN32 */
3538+
#else /* !WIN32 */
35353539
/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
35363540
if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &time) != LDAP_SUCCESS)
35373541
{
@@ -3786,7 +3790,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
37863790

37873791
return 0;
37883792
}
3789-
#endif
3793+
3794+
#endif /* USE_LDAP */
37903795

37913796
#define MAXBUFSIZE 256
37923797

0 commit comments

Comments
 (0)