diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-02-13 10:55:33 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-02-13 10:55:33 +0000 |
commit | 5ea091f9cde6090c4829e78b7d2ac5a566ede8f1 (patch) | |
tree | d4926c7856344dcc4aba9838b734ad0c67acb4ce /src/irmd/api_table.c | |
parent | 344f834e85e9c7afc47e19226157c8e834725d2e (diff) | |
parent | 5cc79cfeb7a33c93ae9ef5781f9b0ecd4a958bee (diff) | |
download | ouroboros-5ea091f9cde6090c4829e78b7d2ac5a566ede8f1.tar.gz ouroboros-5ea091f9cde6090c4829e78b7d2ac5a566ede8f1.zip |
Merged in dstaesse/ouroboros/be-endian (pull request #371)
Check time synchronization upon enrollment
Diffstat (limited to 'src/irmd/api_table.c')
-rw-r--r-- | src/irmd/api_table.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/irmd/api_table.c b/src/irmd/api_table.c index 7619fcf6..df300cea 100644 --- a/src/irmd/api_table.c +++ b/src/irmd/api_table.c @@ -159,16 +159,15 @@ int api_entry_sleep(struct api_entry * e) e->state = API_SLEEP; - while (e->state == API_SLEEP) { - if ((ret = -pthread_cond_timedwait(&e->state_cond, - &e->state_lock, - &dl)) == -ETIMEDOUT) { - break; - } - } + while (e->state == API_SLEEP && ret != -ETIMEDOUT) + ret = -pthread_cond_timedwait(&e->state_cond, + &e->state_lock, + &dl); - if (e->state == API_DESTROY) + if (e->state == API_DESTROY) { + reg_entry_del_api(e->re, e->api); ret = -1; + } e->state = API_INIT; pthread_cond_broadcast(&e->state_cond); |