mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
had it right the first time
This commit is contained in:
@@ -6,14 +6,16 @@ boolean_t
|
|||||||
os_condition_waituntil(os_condition_t *c, os_mutex_t *m, os_time_t *t,
|
os_condition_waituntil(os_condition_t *c, os_mutex_t *m, os_time_t *t,
|
||||||
boolean_t *timeout)
|
boolean_t *timeout)
|
||||||
{
|
{
|
||||||
|
int result;
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
ts.tv_sec = t->seconds;
|
ts.tv_sec = t->seconds;
|
||||||
ts.tv_nsec = t->nanoseconds;
|
ts.tv_nsec = t->nanoseconds;
|
||||||
if (pthread_cond_timedwait(c, m, &ts) == 0) {
|
result = pthread_cond_timedwait(c, m, &ts);
|
||||||
|
if (result == 0) {
|
||||||
*timeout = FALSE;
|
*timeout = FALSE;
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
} else if (errno == ETIMEDOUT) {
|
} else if (result == ETIMEDOUT) {
|
||||||
*timeout = TRUE;
|
*timeout = TRUE;
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user