Skip to content

Commit c6b55be

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 ea8725a commit c6b55be

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
@@ -3415,11 +3415,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
34153415
int port = LDAP_DEF_PORT,
34163416
scope,
34173417
rc,
3418-
msgid,
34193418
size,
34203419
state,
34213420
oldstate,
34223421
i;
3422+
#ifndef WIN32
3423+
int msgid;
3424+
#endif
34233425
bool found_keyword;
34243426
char *url,
34253427
*hostname,
@@ -3564,11 +3566,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35643566

35653567
/*
35663568
* Perform an explicit anonymous bind.
3567-
* LDAP does not require that an anonymous bind is preformed explicitly,
3569+
*
3570+
* LDAP does not require that an anonymous bind is performed explicitly,
35683571
* but we want to distinguish between the case where LDAP bind does not
35693572
* succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
35703573
* the service control file) and the case where querying the LDAP server
35713574
* fails (return 1 to end parsing).
3575+
*
35723576
* Unfortunately there is no way of setting a timeout that works for
35733577
* both Windows and OpenLDAP.
35743578
*/
@@ -3581,7 +3585,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35813585
ldap_unbind(ld);
35823586
return 2;
35833587
}
3584-
#else /* WIN32 */
3588+
#else /* !WIN32 */
35853589
/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
35863590
if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &time) != LDAP_SUCCESS)
35873591
{
@@ -3836,7 +3840,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
38363840

38373841
return 0;
38383842
}
3839-
#endif
3843+
3844+
#endif /* USE_LDAP */
38403845

38413846
#define MAXBUFSIZE 256
38423847

0 commit comments

Comments
 (0)