tapdisk: Fix qcow2 for images > 2 GB
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 27 Jun 2008 13:03:52 +0000 (14:03 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 27 Jun 2008 13:03:52 +0000 (14:03 +0100)
Signed-off-by: Kevin Wolf <kwolf@suse.de>
tools/blktap/drivers/block-qcow2.c

index e435e6e3aa1588427be0762117ff98ae3e0b1dcd..fe28a2ecb005aa154792ef80227c8cc1e9df379d 100644 (file)
@@ -254,10 +254,7 @@ static int bdrv_pread(int fd, int64_t offset, void *buf, int count)
  */
 static int bdrv_pwrite(int fd, int64_t offset, const void *buf, int count)
 {
-       int ret;
-       
-       ret = lseek(fd, offset, SEEK_SET);
-       if (ret != offset) {
+       if (lseek(fd, offset, SEEK_SET) == -1) {
                DPRINTF("bdrv_pwrite failed seek (%#"PRIx64").\n", offset);
                return -1;
        }