[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 11/18] vl: avoid closing stdout with 'writeconfig'
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 11/18] vl: avoid closing stdout with 'writeconfig' |
Date: |
Mon, 28 Apr 2014 09:07:57 +0400 |
From: Chen Gang <address@hidden>
'writeconfig' supports output to stdout (with '-'); when that happens,
we must not close stdout, or further command line options that also use
stdout will be impacted. (Although 'writeconfig' was copied from
'readconfig', the latter does not have the problem because it does not
support reading from '-')
Signed-off-by: Chen Gang <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
vl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 773649f..236f95e 100644
--- a/vl.c
+++ b/vl.c
@@ -3890,7 +3890,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.10.4
- [Qemu-trivial] [PULL 12/18] Add QEMU logo (SVG file), (continued)
- [Qemu-trivial] [PULL 12/18] Add QEMU logo (SVG file), Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 13/18] net/net.c: remove unnecessary semicolon, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 06/18] tests/.gitignore: Ignore test-rfifolock, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 04/18] configure: Improve help behavior, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 18/18] slirp/smb: Move ncalrpc directory to tmp, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 09/18] vl: Eliminate a superfluous local variable, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 08/18] vl: Remove useless 'continue', Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 16/18] po/Makefile: fix $SRC_PATH reference, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 15/18] init_paths: fix minor memory leak, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 11/18] vl: avoid closing stdout with 'writeconfig',
Michael Tokarev <=
- [Qemu-trivial] [PULL 10/18] xilinx: Fix typo in comment (Marvel -> Marvell), Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 17/18] po: add proper Langua ge: tags to .po files, Michael Tokarev, 2014/04/28
- [Qemu-trivial] [PULL 14/18] virtfs-proxy-helper: fix call to accept, Michael Tokarev, 2014/04/28
- Re: [Qemu-trivial] [Qemu-devel] [PULL 00/18] Trivial patches for 2014-04-28, Peter Maydell, 2014/04/28