From ecc96ec75007012109eba772a66e2697114ba969 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 1 Oct 2025 18:40:56 +0100 Subject: [PATCH] system/exit-with-parent: Close the file descriptor before exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On macOS we leak the open file descriptor in the background thread. Close it before returning. Link: https://lists.gnu.org/archive/html/qemu-devel/2026-05/msg04286.html Reported-by: Thomas Huth Fixes: commit 886898baad ("Implement -run-with exit-with-parent=on") Signed-off-by: Richard W.M. Jones Reviewed-by: Thomas Huth Message-ID: <20260518184333.8505-1-rjones@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- system/exit-with-parent.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system/exit-with-parent.c b/system/exit-with-parent.c index df65d2231a..d236944572 100644 --- a/system/exit-with-parent.c +++ b/system/exit-with-parent.c @@ -109,6 +109,7 @@ exit_with_parent_loop(void *vp) /* Behave like Linux and FreeBSD above, as if SIGTERM was sent */ qemu_system_killed(SIGTERM, ppid); } + close(fd); return NULL; }