]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
waitpid: close fd after removal from epoll interest list
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Mon, 12 Jan 2026 18:53:36 +0000 (13:53 -0500)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Sun, 1 Feb 2026 20:08:29 +0000 (15:08 -0500)
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
misc-utils/waitpid.c

index d73a393c09f3f6905b9c92238b2f30f50b17c2e4..865b537e9170d036f05e32999c0de65cd18334af 100644 (file)
@@ -176,6 +176,7 @@ static void wait_for_exits(const struct waitpid_control *ctl, int epll,
                assert((size_t) ret <= active_pids);
                fd = pi->pidfd;
                epoll_ctl(epll, EPOLL_CTL_DEL, fd, NULL);
+               close(fd);
                active_pids -= ret;
        }
 }