summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/fmgr.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-12 13:11:07 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-12 14:57:24 +0200
commit54b1ba99e15660e2e12dbc564f7e7428b5440446 (patch)
tree0a5fead93b09bf15eae5851e4b022f05df3fdae5 /src/ipcpd/normal/fmgr.c
parent44cc6aaa41d88dc978a087178fd74a1c2dba70fd (diff)
downloadouroboros-54b1ba99e15660e2e12dbc564f7e7428b5440446.tar.gz
ouroboros-54b1ba99e15660e2e12dbc564f7e7428b5440446.zip
ipcpd: Fix bootstrap with api_bind
Calling api_bind during bootstrap caused the IRMd to lock up. api_bind is now called after the normal completes bootstrapping.
Diffstat (limited to 'src/ipcpd/normal/fmgr.c')
-rw-r--r--src/ipcpd/normal/fmgr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c
index 70afff37..437dac13 100644
--- a/src/ipcpd/normal/fmgr.c
+++ b/src/ipcpd/normal/fmgr.c
@@ -79,6 +79,7 @@ static void * fmgr_listen(void * o)
{
int fd;
char * ae_name;
+ bool bound = false;
while (true) {
pthread_mutex_lock(&_ipcp->state_lock);
@@ -93,6 +94,14 @@ static void * fmgr_listen(void * o)
}
pthread_mutex_unlock(&_ipcp->state_lock);
+ if (!bound && api_bind(_ipcp->data->dif_name) < 0) {
+ LOG_ERR("Failed to bind the server instance.");
+ pthread_mutex_unlock(&_ipcp->state_lock);
+ return (void *) -1;
+ }
+
+ bound = true;
+
fd = flow_accept(&ae_name);
if (fd < 0) {
LOG_ERR("Failed to accept flow.");