[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/18] savevm.c: fix warning with _FORTIFY_SOUR
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 12/18] savevm.c: fix warning with _FORTIFY_SOURCE |
Date: |
Tue, 22 Dec 2009 19:21:53 +0000 |
On Sun, Dec 20, 2009 at 1:39 AM, Kirill A. Shutemov
<address@hidden> wrote:
> CC savevm.o
> cc1: warnings being treated as errors
> savevm.c: In function 'file_put_buffer':
> savevm.c:342: error: ignoring return value of 'fwrite', declared with
> attribute warn_unused_result
> make: *** [savevm.o] Error 1
>
> Signed-off-by: Kirill A. Shutemov <address@hidden>
> ---
> savevm.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index aefe052..829f735 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -339,8 +339,7 @@ static int file_put_buffer(void *opaque, const uint8_t
> *buf,
> {
> QEMUFileStdio *s = opaque;
> fseek(s->stdio_file, pos, SEEK_SET);
> - fwrite(buf, 1, size, s->stdio_file);
> - return size;
> + return fwrite(buf, 1, size, s->stdio_file);
Looks OK.
The callers do not handle partial writes, but that's because the
return value is not used correctly. They should be fixed some time.
We are truncating size_t to int, but that is OK given that the input
size is also int. The interfaces should be cleaned up to use
size_t/ssize_t later.
- [Qemu-devel] [PATCH 12/18] savevm.c: fix warning with _FORTIFY_SOURCE, (continued)
- [Qemu-devel] [PATCH 12/18] savevm.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 13/18] slirp/misc.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 14/18] vl.c: fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 15/18] monitor.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 16/18] hw/pc.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 17/18] path.c fix warning with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- [Qemu-devel] [PATCH 18/18] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2009/12/19
- Re: [Qemu-devel] [PATCH 17/18] path.c fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 16/18] hw/pc.c: fix warnings with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 14/18] vl.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 12/18] savevm.c: fix warning with _FORTIFY_SOURCE,
Blue Swirl <=
- Re: [Qemu-devel] [PATCH 11/18] usb-linux.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 10/18] net/slirp.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- [Qemu-devel] Re: [PATCH 09/18] block/qcow2.c: fix warnings with _FORTIFY_SOURCE, Andreas Schwab, 2009/12/20
- Re: [Qemu-devel] [PATCH 08/18] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Kevin Wolf, 2009/12/20
- Re: [Qemu-devel] [PATCH 07/18] block/bochs.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
- Re: [Qemu-devel] [PATCH 03/18] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE, Paul Brook, 2009/12/20
Re: [Qemu-devel] [PATCH 02/18] block.c: fix warning with _FORTIFY_SOURCE, Blue Swirl, 2009/12/22
Re: [Qemu-devel] [PATCH 01/18] Do not disable _FORTIFY_SOURCE, Blue Swirl, 2009/12/20