From 49d20e4280d8aa6a9b719211a061394fc72d1cf5 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 17 Sep 2026 03:31:08 -0700 Subject: vmon: don't exit when waitpid() fails w/ECHILD This bug was introduced when 85547b0 added --reaper support. When the waitpid() loop ends with an ECHILD error it shouldn't be a problem, since this loop is intended to consume all eligible children in a batch and may under normal conditions exhaust children. That shouldn't prevent honoring things like --linger, which the existing code interfered with by assigning to vmon->done in the waitpid() error path. Just make the error branch that sets vmon->done conditional on errno != ECHILD, treating that as normal. --- src/vmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmon.c b/src/vmon.c index 7225385..8e11dca 100644 --- a/src/vmon.c +++ b/src/vmon.c @@ -1047,7 +1047,7 @@ int main(int argc, const char * const *argv) } } - if (reaped < 0) { + if (reaped < 0 && errno != ECHILD) { VWM_ERROR("failed to waitpid on SIGCHLD: %s", strerror(errno)); vmon->done = 1; } -- cgit v1.2.3