All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH trivial] vl: Avoid to close stdout after finish 'writeconfig' option
@ 2014-04-20 12:05 Chen Gang
  2014-04-21 15:09 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
  0 siblings, 1 reply; 7+ messages in thread
From: Chen Gang @ 2014-04-20 12:05 UTC (permalink / raw)
  To: Markus Armbruster, Peter Maydell, mjt, aliguori
  Cc: qemu-trivial, QEMU Developers

After finish 'writeconfig' to stdout (with '-'), we want to copy/past
the related information mannually, not for redirection ('readconfig'
does not support '-').

So we can not close the stdout, or next options which may use stdout
will not be displayed.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 vl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vl.c b/vl.c
index 9975e5a..215467f 100644
--- a/vl.c
+++ b/vl.c
@@ -3855,7 +3855,9 @@ int main(int argc, char **argv, char **envp)
                         }
                     }
                     qemu_config_write(fp);
-                    fclose(fp);
+                    if (fp != stdout) {
+                        fclose(fp);
+                    }
                     break;
                 }
             case QEMU_OPTION_qtest:
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-22 19:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-20 12:05 [Qemu-trivial] [PATCH trivial] vl: Avoid to close stdout after finish 'writeconfig' option Chen Gang
2014-04-21 15:09 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2014-04-22  1:00   ` Chen Gang
2014-04-22 16:06   ` Andreas Färber
2014-04-22 16:31     ` Eric Blake
2014-04-22 19:18       ` Peter Maydell
2014-04-22 19:45         ` [Qemu-trivial] commit log tips [was: [Qemu-devel] [PATCH trivial] vl: Avoid to close stdout after finish 'writeconfig' option] Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.