[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/18] block/bochs.c: fix warning with _FORTIFY
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 07/18] block/bochs.c: fix warning with _FORTIFY_SOURCE |
Date: |
Tue, 22 Dec 2009 21:02:05 +0000 |
On Sun, Dec 20, 2009 at 1:39 AM, Kirill A. Shutemov
<address@hidden> wrote:
> CC block/bochs.o
> cc1: warnings being treated as errors
> block/bochs.c: In function 'seek_to_sector':
> block/bochs.c:202: error: ignoring return value of 'read', declared with
> attribute warn_unused_result
> make: *** [block/bochs.o] Error 1
>
> Signed-off-by: Kirill A. Shutemov <address@hidden>
> ---
> block/bochs.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/block/bochs.c b/block/bochs.c
> index bac81c4..f6a18f2 100644
> --- a/block/bochs.c
> +++ b/block/bochs.c
> @@ -199,7 +199,8 @@ static inline int seek_to_sector(BlockDriverState *bs,
> int64_t sector_num)
> // read in bitmap for current extent
> lseek(s->fd, bitmap_offset + (extent_offset / 8), SEEK_SET);
>
> - read(s->fd, &bitmap_entry, 1);
> + if (read(s->fd, &bitmap_entry, 1) != 1)
> + return -1;
I think a short read can't happen with 1 bytes, so this looks fine.
Though error checking is incomplete unless it is extended to lseek() calls too.
- [Qemu-devel] [PATCH 17/18] path.c fix warning with _FORTIFY_SOURCE, (continued)
- 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, 2009/12/22
- 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 <=
- 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