mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-16 22:05:21 -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
6f3c30ded8
commit
c28bba7a55
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