From 19a3277dbff7fc79c12be8a200ab6c8dfe6b50b9 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 21 Mar 2017 16:14:18 +0100 Subject: irmd: Fix timeouts in reg_entry This fixes bad timedwaits for the state of the reg_entry. Also slightly revised timedwaits throughout the prototype. --- src/irmd/registry.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/irmd/registry.c') diff --git a/src/irmd/registry.c b/src/irmd/registry.c index 985ecda0..9512d664 100644 --- a/src/irmd/registry.c +++ b/src/irmd/registry.c @@ -76,7 +76,7 @@ static struct reg_entry * reg_entry_init(struct reg_entry * e, if (pthread_condattr_init(&cattr)) return NULL; -#ifdef __APPLE__ +#ifndef __APPLE__ pthread_condattr_setclock(&cattr, PTHREAD_COND_CLOCK); #endif if (pthread_cond_init(&e->state_cond, &cattr)) @@ -429,7 +429,7 @@ int reg_entry_leave_state(struct reg_entry * e, if (timeout) ret = -pthread_cond_timedwait(&e->state_cond, &e->state_lock, - timeout); + &abstime); else ret = -pthread_cond_wait(&e->state_cond, &e->state_lock); @@ -468,7 +468,7 @@ int reg_entry_wait_state(struct reg_entry * e, if (timeout) ret = -pthread_cond_timedwait(&e->state_cond, &e->state_lock, - timeout); + &abstime); else ret = -pthread_cond_wait(&e->state_cond, &e->state_lock); -- cgit v1.2.3