summaryrefslogtreecommitdiff
path: root/src/coordinator.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-11-29 21:49:46 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2014-11-29 21:49:46 +0100
commit7f10a53e805f26f3c6e0cceea5569b40a43af275 (patch)
tree6b9b1232a4360ccee69bd6c7f9e3f17c94117417 /src/coordinator.c
parent57aadcf79d1bb62793875e46030ee27dc42f5237 (diff)
downloadbiruda-7f10a53e805f26f3c6e0cceea5569b40a43af275.tar.gz
biruda-7f10a53e805f26f3c6e0cceea5569b40a43af275.tar.bz2
first starting worker
Diffstat (limited to 'src/coordinator.c')
-rw-r--r--src/coordinator.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/coordinator.c b/src/coordinator.c
index 8c34997..6ac9a6e 100644
--- a/src/coordinator.c
+++ b/src/coordinator.c
@@ -1,4 +1,5 @@
#include "coordinator.h"
+#include "worker.h"
#include "pthread.h"
@@ -135,8 +136,9 @@ static char *create_register_answer( )
static int coordinator_start_worker( const char *name, bool *found )
{
+ worker_t *w = NULL;
for( int i = 0; i < nof_workers; i++ ) {
- worker_t *w = &worker[i];
+ w = &worker[i];
if( strcmp( name, w->name ) == 0 ) {
*found = true;
break;
@@ -149,6 +151,8 @@ static int coordinator_start_worker( const char *name, bool *found )
printf( "STARTING WORKER '%s'\n", name );
+ worker_init( w );
+
return 0;
}
@@ -203,7 +207,8 @@ static void *coordinator_func( void *thread_data )
const char *worker = json_object_get_string( worker_obj );
bool found;
- int res = coordinator_start_worker( worker, &found );
+ /*int res = */
+ (void)coordinator_start_worker( worker, &found );
char *msg = create_worker_started_answer( worker, found );
size_t msg_size = strlen( msg ) + 1;