summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2026-09-17 03:31:08 -0700
committerVito Caputo <vcaputo@pengaru.com>2026-09-17 03:31:08 -0700
commit49d20e4280d8aa6a9b719211a061394fc72d1cf5 (patch)
tree0da5a5d5916af8935790330f48e552026e58fe03
parentf2e46a34323ee2b9c2b8d9f03b8840fa339ff14a (diff)
vmon: don't exit when waitpid() fails w/ECHILDHEADmaster
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.
-rw-r--r--src/vmon.c2
1 files changed, 1 insertions, 1 deletions
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;
}
© All Rights Reserved