aboutsummaryrefslogtreecommitdiff
path: root/reaper.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-12 08:20:02 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-21 10:55:15 +0000
commita698fa62e28468ec52b2408cdc293803a3965dfe (patch)
tree6ff868a53c8a228218a332f20f13ad647bf5aaa2 /reaper.c
parentwayland: take rotation into account when calculating the logical PPI (diff)
reaper: add reaper_del() - pid is no longer watched/monitored after this
Diffstat (limited to 'reaper.c')
-rw-r--r--reaper.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/reaper.c b/reaper.c
index 8ebd31a4..15e08539 100644
--- a/reaper.c
+++ b/reaper.c
@@ -98,6 +98,17 @@ reaper_add(struct reaper *reaper, pid_t pid, reaper_cb cb, void *cb_data)
((struct child){.pid = pid, .cb = cb, .cb_data = cb_data}));
}
+void
+reaper_del(struct reaper *reaper, pid_t pid)
+{
+ tll_foreach(reaper->children, it) {
+ if (it->item.pid == pid) {
+ tll_remove(reaper->children, it);
+ break;
+ }
+ }
+}
+
static bool
fdm_reap(struct fdm *fdm, int fd, int events, void *data)
{