system/exit-with-parent: Close the file descriptor before exit

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 <rjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260518184333.8505-1-rjones@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
Richard W.M. Jones
2025-10-01 18:40:56 +01:00
committed by Philippe Mathieu-Daudé
parent 2db9152854
commit ecc96ec750

View File

@@ -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;
}