summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-06-03 08:37:44 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-06-03 08:37:44 -0500
commit7087d3df18b8e8d27a2115dfc5d56614073e55de (patch)
treec4fa196641d565e8a3474d240584beaf10495084 /savevm.c
parentf10acc8b38d65a66ffa0588a036489d7fa6a593e (diff)
parenta4cc73d629d43c8a4d171d043ff229a959df3ca6 (diff)
downloadqemu-7087d3df18b8e8d27a2115dfc5d56614073e55de.tar.gz
Merge remote-tracking branch 'mjt/trivial-patches' into staging
# By Ed Maste (3) and others # Via Michael Tokarev * mjt/trivial-patches: do not check pointers after dereferencing them m25p80: Add Micron n25q032a qemu: fix out of tree cross compile slirp: cleanup leftovers from misc.h migration: Remove duplicate bandwidth_limit set docs: Fix typo and update file in migration configure: try pkg-config ncurses first rtc: remove rtc_set_date linux-user: Fix typo in comment configure: remove confusing file manipulation debugcon: fix compiler warning when open DEBUG_DEBUGCON debugcon: make debug message more readable debugcon: fix always print "addr=0x0, val=0x0" bug when use DEBUG_DEBUGCON Remove unnecessary break statements don't run pkg-config for features explicitly disabled Message-id: 51A9CCFB.1000109@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/savevm.c b/savevm.c
index 31dcce975e..4e0fab6cd6 100644
--- a/savevm.c
+++ b/savevm.c
@@ -322,13 +322,13 @@ QEMUFile *qemu_popen_cmd(const char *command, const char *mode)
FILE *stdio_file;
QEMUFileStdio *s;
- stdio_file = popen(command, mode);
- if (stdio_file == NULL) {
+ if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
+ fprintf(stderr, "qemu_popen: Argument validity check failed\n");
return NULL;
}
- if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
- fprintf(stderr, "qemu_popen: Argument validity check failed\n");
+ stdio_file = popen(command, mode);
+ if (stdio_file == NULL) {
return NULL;
}