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/ipcpd/shim-data.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/ipcpd/shim-data.c') diff --git a/src/ipcpd/shim-data.c b/src/ipcpd/shim-data.c index 933f3a64..bec2486c 100644 --- a/src/ipcpd/shim-data.c +++ b/src/ipcpd/shim-data.c @@ -492,12 +492,10 @@ int shim_data_dir_query_wait(struct dir_query * query, query->state = QUERY_PENDING; - while (query->state == QUERY_PENDING) { - if ((ret = -pthread_cond_timedwait(&query->cond, - &query->lock, - &abstime)) == -ETIMEDOUT) - break; - } + while (query->state == QUERY_PENDING && ret != -ETIMEDOUT) + ret = -pthread_cond_timedwait(&query->cond, + &query->lock, + &abstime); if (query->state == QUERY_DESTROY) ret = -1; -- cgit v1.2.3