[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/15] monitor.c: fix warnings with _FORTIFY_SOURCE
From: |
Kirill A. Shutemov |
Subject: |
[Qemu-devel] [PATCH 11/15] monitor.c: fix warnings with _FORTIFY_SOURCE |
Date: |
Sat, 2 Jan 2010 05:45:29 +0200 |
CC i386-softmmu/monitor.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_memory_save':
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1318: error: ignoring return value of
'fwrite', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function
'do_physical_memory_save':
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1345: error: ignoring return value of
'fwrite', declared with attribute warn_unused_result
make[1]: *** [monitor.o] Error 1
Signed-off-by: Kirill A. Shutemov <address@hidden>
---
monitor.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/monitor.c b/monitor.c
index c0dc48e..54c7323 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1320,10 +1320,14 @@ static void do_memory_save(Monitor *mon, const QDict
*qdict, QObject **ret_data)
if (l > size)
l = size;
cpu_memory_rw_debug(env, addr, buf, l, 0);
- fwrite(buf, 1, l, f);
+ if (fwrite(buf, 1, l, f) != l) {
+ monitor_printf(mon, "fwrite() failed\n");
+ goto exit;
+ }
addr += l;
size -= l;
}
+exit:
fclose(f);
}
@@ -1347,11 +1351,15 @@ static void do_physical_memory_save(Monitor *mon, const
QDict *qdict,
if (l > size)
l = size;
cpu_physical_memory_rw(addr, buf, l, 0);
- fwrite(buf, 1, l, f);
+ if (fwrite(buf, 1, l, f) != l) {
+ monitor_printf(mon, "fwrite() failed\n");
+ goto exit;
+ }
fflush(f);
addr += l;
size -= l;
}
+exit:
fclose(f);
}
--
1.6.5.7
- [Qemu-devel] [PATCH 01/15] Introduce qemu_write_full(), Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 02/15] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 03/15] block/cow.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 04/15] block/qcow.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 05/15] block/vmdk.o: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 06/15] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 07/15] block/qcow2.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 08/15] net/slirp.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 09/15] usb-linux.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 10/15] vl.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 11/15] monitor.c: fix warnings with _FORTIFY_SOURCE,
Kirill A. Shutemov <=
- [Qemu-devel] [PATCH 12/15] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 13/15] Enable _FORTIFY_SOURCE=2, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 14/15] Add -fstack-protector-all to CFLAGS, Kirill A. Shutemov, 2010/01/01
- [Qemu-devel] [PATCH 15/15] linux-user: fix return value of mmap_frag(), Kirill A. Shutemov, 2010/01/01
- Message not available
- [Qemu-devel] Re: [PATCH 09/15] usb-linux.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/05
- [Qemu-devel] Re: [PATCH 09/15] usb-linux.c: fix warning with _FORTIFY_SOURCE, Michael S. Tsirkin, 2010/01/05
[Qemu-devel] Re: [PATCH 01/15] Introduce qemu_write_full(), Paolo Bonzini, 2010/01/02