summaryrefslogtreecommitdiffstats
path: root/ui/common
diff options
context:
space:
mode:
Diffstat (limited to 'ui/common')
-rw-r--r--ui/common/ui-system.c26
-rw-r--r--ui/common/ui-system.h2
2 files changed, 17 insertions, 11 deletions
diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c
index ad3bfba..9ab8dec 100644
--- a/ui/common/ui-system.c
+++ b/ui/common/ui-system.c
@@ -28,6 +28,7 @@
#include "log/log.h"
#include <system/system.h>
+#include <process/process.h>
#include "talloc/talloc.h"
#include "ui-system.h"
@@ -35,22 +36,27 @@
* pb_start_daemon - start the pb-discover daemon.
*/
-int pb_start_daemon(void)
+int pb_start_daemon(void *ctx)
{
+ struct process *process;
+ const char **argv;
int result;
- const char *argv[2];
- char *name = talloc_asprintf(NULL, "%s/sbin/pb-discover",
- pb_system_apps.prefix);
+ char *name;
- argv[0] = name;
- argv[1] = NULL;
+ process = process_create(ctx);
+
+ argv = talloc_array(process, const char *, 2);
+ name = talloc_asprintf(process, "%s/sbin/pb-discover",
+ pb_system_apps.prefix);
- result = pb_run_cmd(argv, 0, 0);
+ argv[0] = name;
+ argv[1] = NULL;
- talloc_free(name);
+ process->path = name;
+ process->argv = argv;
- if (result)
- pb_log("%s: failed: (%d)\n", __func__, result);
+ result = process_run_async(process);
+ process_release(process);
return result;
}
diff --git a/ui/common/ui-system.h b/ui/common/ui-system.h
index 5ce501a..3b7d341 100644
--- a/ui/common/ui-system.h
+++ b/ui/common/ui-system.h
@@ -28,7 +28,7 @@
#include <signal.h>
-int pb_start_daemon(void);
+int pb_start_daemon(void *ctx);
unsigned int pb_elf_hash(const char *str);
unsigned int pb_cat_hash(const char *a, const char *b);
OpenPOWER on IntegriCloud