summaryrefslogtreecommitdiff
path: root/src/irmd/proc_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/irmd/proc_table.c')
-rw-r--r--src/irmd/proc_table.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/irmd/proc_table.c b/src/irmd/proc_table.c
index 8a25831a..ee87813d 100644
--- a/src/irmd/proc_table.c
+++ b/src/irmd/proc_table.c
@@ -184,19 +184,13 @@ void proc_entry_del_name(struct proc_entry * e,
}
int proc_entry_sleep(struct proc_entry * e,
- struct timespec * timeo)
+ struct timespec * dl)
{
- struct timespec dl;
int ret = 0;
assert(e);
- if (timeo != NULL) {
- clock_gettime(PTHREAD_COND_CLOCK, &dl);
- ts_add(&dl, timeo, &dl);
- }
-
pthread_mutex_lock(&e->lock);
if (e->state != PROC_WAKE && e->state != PROC_DESTROY)
@@ -205,8 +199,8 @@ int proc_entry_sleep(struct proc_entry * e,
pthread_cleanup_push(cancel_proc_entry, e);
while (e->state == PROC_SLEEP && ret != -ETIMEDOUT)
- if (timeo)
- ret = -pthread_cond_timedwait(&e->cond, &e->lock, &dl);
+ if (dl != NULL)
+ ret = -pthread_cond_timedwait(&e->cond, &e->lock, dl);
else
ret = -pthread_cond_wait(&e->cond, &e->lock);