]> git.proxmox.com Git - qemu.git/commitdiff
block/bochs.c: fix warning with _FORTIFY_SOURCE
authorKirill A. Shutemov <kirill@shutemov.name>
Fri, 25 Dec 2009 18:19:20 +0000 (18:19 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Fri, 25 Dec 2009 18:19:20 +0000 (18:19 +0000)
  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>
block/bochs.c

index bac81c42b7922378c1669bcb476a4211bcbb0f45..f6a18f2bcbd99f5b0d522ed31e6f3b5c102fd07e 100644 (file)
@@ -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))
     {