From 41a86d9026d9bc8ed46274ac043eb90a867df52f Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 14 Jul 2016 18:54:04 +0200 Subject: irmd: Fix AE name always set to NULL --- src/irmd/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/irmd') diff --git a/src/irmd/main.c b/src/irmd/main.c index 17e51c05..1da4b310 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -771,8 +771,6 @@ static struct port_map_entry * flow_accept(pid_t api, return NULL; } - rne->req_ae_name = NULL; - if (dst_ae_name != NULL) *dst_ae_name = rne->req_ae_name; @@ -1179,14 +1177,17 @@ static struct port_map_entry * flow_req_arr(pid_t api, pthread_mutex_unlock(&rne->state_lock); + pthread_rwlock_unlock(&instance->state_lock); + while (acc_wait) { + pthread_rwlock_rdlock(&instance->state_lock); pthread_mutex_lock(&rne->state_lock); - acc_wait = (rne->state == REG_NAME_FLOW_ARRIVED); + acc_wait = (rne->state == REG_NAME_FLOW_ARRIVED && + instance->state == IRMD_RUNNING); pthread_mutex_unlock(&rne->state_lock); + pthread_rwlock_unlock(&instance->state_lock); } - pthread_rwlock_unlock(&instance->state_lock); - return pme; } -- cgit v1.2.3