Re: [PATCH] system/exit-with-parent.c: Close the file descriptor before exit

Thomas Huth <[email protected]> Tue, 19 May 2026 05:59:02 +0200
Newsgroups org.nongnu.qemu-trivial,org.nongnu.qemu-devel
Message-ID <[email protected]>
On 18/05/2026 20.43, Richard W.M. Jones wrote:
> 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 <[email protected]>
> ---
>   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;
>   }

Reviewed-by: Thomas Huth <[email protected]>