* [Qemu-devel] [PATCH] fix raw_pread_aligned return value
@ 2009-05-25 8:08 Christoph Hellwig
0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2009-05-25 8:08 UTC (permalink / raw)
To: qemu-devel
raw_pread_aligned currently returns the raw return value from
lseek/read, which is always -1 in case of an error. But the
callers higher up the stack expect it to return the negated
errno just like raw_pwrite_aligned.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: qemu/block/raw-posix.c
===================================================================
--- qemu.orig/block/raw-posix.c 2009-05-25 10:04:39.044840256 +0200
+++ qemu/block/raw-posix.c 2009-05-25 10:05:16.233848281 +0200
@@ -253,7 +253,7 @@ static int raw_pread_aligned(BlockDriver
label__raw_read__success:
- return ret;
+ return (ret < 0) ? -errno : ret;
}
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-25 8:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25 8:08 [Qemu-devel] [PATCH] fix raw_pread_aligned return value Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).