if (!server)
return EXIT_FAILURE;
- procset = process_init(server, waitset);
+ procset = process_init(server, waitset, opts.dry_run == opt_yes);
if (!procset)
return EXIT_FAILURE;
struct list async_list;
int sigchld_pipe[2];
struct waiter *sigchld_waiter;
+ bool dry_run;
};
/* Internal data type for process handling
return 0;
}
-struct procset *process_init(void *ctx, struct waitset *set)
+struct procset *process_init(void *ctx, struct waitset *set, bool dry_run)
{
struct sigaction sa;
int rc;
procset = talloc(ctx, struct procset);
procset->waitset = set;
+ procset->dry_run = dry_run;
list_init(&procset->async_list);
rc = pipe(procset->sigchld_pipe);
if (pid == 0) {
process_setup_stdout_child(procinfo);
+ if (procset->dry_run)
+ exit(EXIT_SUCCESS);
execvp(process->path, (char * const *)process->argv);
exit(EXIT_FAILURE);
}
* process_create. The pointer returned can be talloc_free()-ed, or can be
* automatically freed through destruction of the ctx talloc tree.
*/
-struct procset *process_init(void *ctx, struct waitset *set);
+struct procset *process_init(void *ctx, struct waitset *set, bool dry_run);
struct process *process_create(void *ctx);
cui->platform_info = platform_info;
cui->waitset = waitset_create(cui);
- process_init(cui, cui->waitset);
+ process_init(cui, cui->waitset, false);
setlocale(LC_ALL, "");
};
struct cui *cui_init(void* platform_info,
- int (*js_map)(const struct js_event *e), int start_deamon);
+ int (*js_map)(const struct js_event *e),
+ int start_deamon);
struct nc_scr *cui_set_current(struct cui *cui, struct nc_scr *scr);
int cui_run(struct cui *cui, struct pmenu *main, unsigned int default_item);
int cui_boot_editor_run(struct pmenu_item *item);
pbt_client->waitset = waitset_create(pbt_client);
- process_init(pbt_client, pbt_client->waitset);
+ process_init(pbt_client, pbt_client->waitset, false);
pbt_client->sig = "pbt_client";
pbt_client->frame.scr = pbt_scr_init(pbt_client, pbt_client->waitset,