qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] qemu-nbd: Close inherited stderr


From: Raphael Pour
Subject: Re: [PATCH] qemu-nbd: Close inherited stderr
Date: Wed, 13 May 2020 09:14:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/12/20 3:57 PM, Eric Blake wrote:
> Wouldn't it just be simpler to not dup in the first place?
> 
> diff --git i/qemu-nbd.c w/qemu-nbd.c
> index 4aa005004ebd..6ba2544feb3a 100644
> --- i/qemu-nbd.c
> +++ w/qemu-nbd.c
> @@ -916,7 +916,9 @@ int main(int argc, char **argv)
>          } else if (pid == 0) {
>              close(stderr_fd[0]);
> 
> -            old_stderr = dup(STDERR_FILENO);
> +            if (fork_process) {
> +                old_stderr = dup(STDERR_FILENO);
> +            }
>              ret = qemu_daemon(1, 0);
> 
>              /* Temporarily redirect stderr to the parent's pipe...  */

Yes, you're right. We tested your patch and it also fixes the unwanted
open stderr.

Could you consider this patch in one of the next releases?

Thanks!
Raphael

-- 
Hetzner Online GmbH
Am Datacenter-Park 1
08223 Falkenstein/Vogtland
address@hidden
www.hetzner.com

Registergericht Ansbach, HRB 6089
Geschäftsführer: Martin Hetzner, Stephan Konvickova, Günther Müller

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]