mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
reaper: add optional callback
When calling ‘reaper_add()’, the caller can provide a callback. If non-NULL, the reaper will call the callback to handle the actual reaping. If the callback is NULL, or if it returns false, the reaper reaps the child process.
This commit is contained in:
parent
d778dc3d2a
commit
3c6789fb8b
3 changed files with 40 additions and 21 deletions
2
spawn.c
2
spawn.c
|
|
@ -55,7 +55,7 @@ spawn(struct reaper *reaper, const char *cwd, char *const argv[],
|
|||
close(pipe_fds[0]);
|
||||
|
||||
if (ret == 0) {
|
||||
reaper_add(reaper, pid);
|
||||
reaper_add(reaper, pid, NULL, NULL);
|
||||
return true;
|
||||
} else if (ret < 0) {
|
||||
LOG_ERRNO("failed to read from pipe");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue