aboutsummaryrefslogtreecommitdiff
path: root/block/bochs.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2009-12-25 18:19:20 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-12-25 18:19:20 +0000
commit00ccf932a0e0f0f1cbc6cdb9db5495dd5ebedd5a (patch)
tree58889dfa06fe067cb24f44b9581b4e20182b6993 /block/bochs.c
parent5fdb3aa16ab7628c4c3ffcbfb6861b2ad7643a6b (diff)
block/bochs.c: fix warning with _FORTIFY_SOURCE
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 <kirill@shutemov.name> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'block/bochs.c')
-rw-r--r--block/bochs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/bochs.c b/block/bochs.c
index bac81c42b7..f6a18f2bcb 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))
{