void run_one_by_one(GPid pid, gint status, HookInfo* info) { if (pid != -1) { g_spawn_close_pid(pid); } if (info->jobs->data == NULL) { g_list_free_full(g_list_first(info->jobs), g_free); enter_next_stage(); return; } gint std_out, std_err; GPid child_pid; GError* error = NULL; char* argv[2]; argv[0] = info->jobs->data; argv[1] = 0; g_debug("RUN :%s\n", (char*)info->jobs->data); g_spawn_async(info->jobs_path, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &child_pid, &error); if (error != NULL) { g_error("can't spawn %s: %s\n", argv[0], error->message); g_error_free(error); return; } g_child_watch_add(child_pid, (GChildWatchFunc)run_one_by_one, info); info->jobs = g_list_next(info->jobs); info->current_job_num = g_list_index(info->jobs, info->jobs->data) + 1; update_hooks_progress(info); }
static void start_run_installer() { g_message("[%s]\n", __func__); ped_device_free_all(); enter_next_stage(); }