honor -1 timeout (ITS#6388)

This commit is contained in:
Pierangelo Masarati 2009-11-18 14:57:52 +00:00
parent 272abc5561
commit a95b8cd488
2 changed files with 6 additions and 2 deletions

View file

@ -48,7 +48,11 @@ is a NULL pointer, the LDAP_OPT_TIMEOUT value set by
is used. With the default setting,
the select blocks indefinitely. To
effect a poll, the timeout argument should be a non-NULL
pointer, pointing to a zero-valued timeval structure. See
pointer, pointing to a zero-valued timeval structure.
To obtain the behavior of the default setting, bypassing any value set by
.BR ldap_set_option (3),
set to -1 the \fItv_sec\fP field of the \fItimeout\fP parameter.
See
.BR select (2)
for further details.
.LP

View file

@ -276,7 +276,7 @@ wait4msg(
}
#endif /* LDAP_DEBUG */
if ( timeout != NULL ) {
if ( timeout != NULL && timeout->tv_sec != -1 ) {
tv0 = *timeout;
tv = *timeout;
tvp = &tv;