On 5/14/20 4:55 PM, Eric Blake wrote: > On 5/14/20 9:29 AM, Eric Blake wrote: > >>> WARNING: Block comments use a leading /* on a separate line >>> #20: FILE: qemu-nbd.c:919: >>> + /* Remember parents stderr only if the fork option is set. >>> > >> The comment could use some grammar help (s/parents/parent's/), and in >> truth, I don't think it adds much beyond what the code itself is >> already doing, so rather than adding another line to silence patchew, >> you could instead just eliminate the comment and life would still be >> fine. Or if you want a one-line comment, I might suggest: >> >> /* Remember parent's stderr if we will restoring it. */ > > It helps if I don't hit 'send' too early. > > /* Remember parent's stderr if we will be restoring it. */ >
From e5749541494abcdcaa37d752172741e1bc38e984 Mon Sep 17 00:00:00 2001 From: Raphael Pour <raphael.p...@hetzner.com> Date: Fri, 15 May 2020 08:30:50 +0200 Subject: [PATCH] qemu-nbd: Close inherited stderr Close inherited stderr of the parent if fork_process is false. Otherwise no one will close it. (introduced by e6df58a5) Signed-off-by: Raphael Pour <raphael.p...@hetzner.com> --- qemu-nbd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 4aa005004e..306e44fb0a 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -916,7 +916,11 @@ int main(int argc, char **argv) } else if (pid == 0) { close(stderr_fd[0]); - old_stderr = dup(STDERR_FILENO); + /* Remember parent's stderr if we will be restoring it. */ + if (fork_process) { + old_stderr = dup(STDERR_FILENO); + } + ret = qemu_daemon(1, 0); /* Temporarily redirect stderr to the parent's pipe... */ -- 2.25.4 I fixed the issues and checkpatch gave me a 'ready for submission'. Is this the right way to submit a fixed patch or should it be a v3? -- 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
signature.asc
Description: OpenPGP digital signature