X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=ui%2Fcommon%2Fui-system.c;h=02142dbf303a1e993dcc39897d2773f73297cb5c;hp=ad3bfba8a9d4534507f849925fd3e2b42bc26afd;hb=c4be9490a5d94b662370576157b6e0ed73f2fe77;hpb=c62667e5c78ea212e5ac49244e9792954a1d8f71 diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c index ad3bfba..02142db 100644 --- a/ui/common/ui-system.c +++ b/ui/common/ui-system.c @@ -16,7 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define _GNU_SOURCE +#if defined(HAVE_CONFIG_H) +#include "config.h" +#endif #include #include @@ -28,6 +30,7 @@ #include "log/log.h" #include +#include #include "talloc/talloc.h" #include "ui-system.h" @@ -35,22 +38,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; } @@ -70,7 +78,7 @@ unsigned int pb_elf_hash(const char *str) h ^= g >> 24; h &= ~g; } - pb_log("%s: %x\n", __func__, h); + pb_log_fn("%x\n", h); return h; }