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
raphael.p...@hetzner.com
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