Commit graph

7 commits

Author SHA1 Message Date
Daniel Eklöf
a698fa62e2
reaper: add reaper_del() - pid is no longer watched/monitored after this 2021-01-21 11:55:15 +01:00
Daniel Eklöf
c28bba7a55
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.
2021-01-21 11:43:57 +01:00
Craig Barnes
104fe2fa55 Fix some spelling mistakes 2020-08-15 19:39:00 +01:00
Craig Barnes
4e6100494c Handle allocation failures explicitly in *_init() functions 2020-08-09 08:55:20 +01:00
Craig Barnes
7a77958ba2 Convert most dynamic allocations to use functions from xmalloc.h 2020-08-08 20:37:57 +01:00
Daniel Eklöf
89dd31bfd7
reaper: disable debug logging 2020-05-21 20:27:42 +02:00
Daniel Eklöf
f49742ebba
reaper: new module, uses a signalfd to wait() on child processes
Use a signalfd to listen for SIGCHLD signals.

When we receive a SIGCHLD over the signalfd, reap all dead children by
looping over all registered child PIDs and call waitpid(WNOHANG) on
them.
2020-05-21 20:15:10 +02:00