summaryrefslogtreecommitdiff
path: root/src/worker.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/worker.c
parent57aadcf79d1bb62793875e46030ee27dc42f5237 (diff)
downloadbiruda-7f10a53e805f26f3c6e0cceea5569b40a43af275.tar.gz
biruda-7f10a53e805f26f3c6e0cceea5569b40a43af275.tar.bz2
first starting worker
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/worker.c b/src/worker.c
index 76fd2a4..4d2db69 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -30,12 +30,20 @@ worker_execution_mode_t worker_execution_mode_from_str( const char *s )
}
}
-int worker_init( const char *control )
+int worker_init( worker_t *worker )
{
- //~ gboolean ret = g_spawn_async_with_pipes( NULL,
-//~ ret = g_spawn_async_with_pipes( NULL, argv, NULL,
- //~ G_SPAWN_DO_NOT_REAP_CHILD, NULL,
- //~ NULL, &pid, NULL, &out, &err, NULL );
+ gchar *argv[] = { worker->command, NULL };
+ GPid pid;
+ gint out, err;
+
+ gboolean ret = g_spawn_async_with_pipes( NULL,
+ argv, NULL, 0, NULL,
+ NULL, &pid, NULL, &out, &err, NULL );
+ if( !ret ) {
+ g_error( "Starting worker failed" );
+ return -1;
+ }
+
return 0;
}