diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-04 19:37:40 +0100 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-04 19:44:28 +0100 |
commit | 51d814cd8071684150cae474dde680781ea5ce1e (patch) | |
tree | 8924ee430d2c33631468ae9be56a7487c6f6448b /src | |
parent | ce64aa294574cc94355f5d744e8d0342a0f19769 (diff) | |
download | ouroboros-51d814cd8071684150cae474dde680781ea5ce1e.tar.gz ouroboros-51d814cd8071684150cae474dde680781ea5ce1e.zip |
ipcpd: Fix state in ipcp_boot
The state must be set to IPCP_INIT before the main_loop threads are
started or else they will exit if they reach the check earlier than
the state is set.
Diffstat (limited to 'src')
-rw-r--r-- | src/ipcpd/ipcp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index e44fafe2..2e4c3fca 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -334,6 +334,9 @@ int ipcp_init(enum ipcp_type type, struct ipcp_ops * ops) int ipcp_boot() { int t; + + ipcp_set_state(IPCP_INIT); + for (t = 0; t < IPCPD_THREADPOOL_SIZE; ++t) { if (pthread_create(&ipcpi.threadpool[t], NULL, ipcp_main_loop, NULL)) { @@ -346,8 +349,6 @@ int ipcp_boot() } } - ipcpi.state = IPCP_INIT; - return 0; } |