From: Pierangelo Masarati Date: Wed, 18 Nov 2009 14:57:52 +0000 (+0000) Subject: honor -1 timeout (ITS#6388) X-Git-Tag: ACLCHECK_0~105 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a95b8cd488e13cdc89670af3f17127673835491d;p=openldap honor -1 timeout (ITS#6388) --- diff --git a/doc/man/man3/ldap_result.3 b/doc/man/man3/ldap_result.3 index af572bb5fa..50e704fea5 100644 --- a/doc/man/man3/ldap_result.3 +++ b/doc/man/man3/ldap_result.3 @@ -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 diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index afdc236ea7..01f8d51cb1 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -276,7 +276,7 @@ wait4msg( } #endif /* LDAP_DEBUG */ - if ( timeout != NULL ) { + if ( timeout != NULL && timeout->tv_sec != -1 ) { tv0 = *timeout; tv = *timeout; tvp = &tv;