Skip to content

Commit 757ade4

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 a1b9c46 commit 757ade4

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
@@ -3134,11 +3134,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
31343134
int port = LDAP_DEF_PORT,
31353135
scope,
31363136
rc,
3137-
msgid,
31383137
size,
31393138
state,
31403139
oldstate,
31413140
i;
3141+
#ifndef WIN32
3142+
int msgid;
3143+
#endif
31423144
bool found_keyword;
31433145
char *url,
31443146
*hostname,
@@ -3283,11 +3285,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
32833285

32843286
/*
32853287
* Perform an explicit anonymous bind.
3286-
* LDAP does not require that an anonymous bind is preformed explicitly,
3288+
*
3289+
* LDAP does not require that an anonymous bind is performed explicitly,
32873290
* but we want to distinguish between the case where LDAP bind does not
32883291
* succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
32893292
* the service control file) and the case where querying the LDAP server
32903293
* fails (return 1 to end parsing).
3294+
*
32913295
* Unfortunately there is no way of setting a timeout that works for
32923296
* both Windows and OpenLDAP.
32933297
*/
@@ -3300,7 +3304,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
33003304
ldap_unbind(ld);
33013305
return 2;
33023306
}
3303-
#else /* WIN32 */
3307+
#else /* !WIN32 */
33043308
/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
33053309
if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &time) != LDAP_SUCCESS)
33063310
{
@@ -3555,7 +3559,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35553559

35563560
return 0;
35573561
}
3558-
#endif
3562+
3563+
#endif /* USE_LDAP */
35593564

35603565
#define MAXBUFSIZE 256
35613566

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