From patchwork Sun Dec 20 01:39:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [07/18] block/bochs.c: fix warning with _FORTIFY_SOURCE From: "Kirill A. Shutemov" X-Patchwork-Id: 41494 Message-Id: <1261273167-3240-7-git-send-email-kirill@shutemov.name> To: qemu-devel@nongnu.org Cc: "Kirill A. Shutemov" Date: Sun, 20 Dec 2009 03:39:16 +0200 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 --- 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; if (!((bitmap_entry >> (extent_offset % 8)) & 1)) {