mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
make sure unsigned time_t doesn't hurt (follow-on to ITS#4872)
This commit is contained in:
parent
9be22e18bf
commit
2ad757793d
@ -2113,8 +2113,14 @@ slapd_daemon_task(
|
||||
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
|
||||
|
||||
if ( rtask && cat.tv_sec ) {
|
||||
time_t diff = difftime( cat.tv_sec, now );
|
||||
if ( diff == 0 ) diff = tdelta;
|
||||
/* NOTE: diff __should__ always be >= 0,
|
||||
* AFAI understand; however (ITS#4872),
|
||||
* time_t might be unsigned in some systems,
|
||||
* while difftime() returns a double */
|
||||
double diff = difftime( cat.tv_sec, now );
|
||||
if ( diff <= 0 ) {
|
||||
diff = tdelta;
|
||||
}
|
||||
if ( tvp == NULL || diff < tv.tv_sec ) {
|
||||
tv.tv_sec = diff;
|
||||
tv.tv_usec = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user