From a95b8cd488e13cdc89670af3f17127673835491d Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 18 Nov 2009 14:57:52 +0000 Subject: [PATCH] honor -1 timeout (ITS#6388) --- doc/man/man3/ldap_result.3 | 6 +++++- libraries/libldap/result.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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; -- 2.39.5