mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
spawn: add optional reaper callback, return pid_t
This will allow spawn() callers to do things when the spawned process has terminated.
This commit is contained in:
parent
57af75f988
commit
a42f990818
6 changed files with 26 additions and 19 deletions
6
notify.c
6
notify.c
|
|
@ -59,7 +59,11 @@ notify_notify(const struct terminal *term, const char *title, const char *body,
|
|||
|
||||
/* Redirect stdin to /dev/null, but ignore failure to open */
|
||||
int devnull = open("/dev/null", O_RDONLY);
|
||||
spawn(term->reaper, NULL, argv, devnull, -1, -1, NULL);
|
||||
pid_t pid = spawn(
|
||||
term->reaper, NULL, argv, devnull, stdout_fds[1], -1,
|
||||
¬if_done, (void *)term, NULL);
|
||||
|
||||
if (stdout_fds[1] >= 0) {
|
||||
|
||||
if (devnull >= 0)
|
||||
close(devnull);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue