diff options
Diffstat (limited to 'block/file-win32.c')
-rw-r--r-- | block/file-win32.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/file-win32.c b/block/file-win32.c index 800fabd..7872e00 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/cutils.h" -#include "qemu/timer.h" #include "block/block_int.h" #include "qemu/module.h" #include "block/raw-aio.h" @@ -461,7 +460,7 @@ static void raw_close(BlockDriverState *bs) } } -static int raw_truncate(BlockDriverState *bs, int64_t offset) +static int raw_truncate(BlockDriverState *bs, int64_t offset, Error **errp) { BDRVRawState *s = bs->opaque; LONG low, high; @@ -476,11 +475,11 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset) */ dwPtrLow = SetFilePointer(s->hfile, low, &high, FILE_BEGIN); if (dwPtrLow == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) { - fprintf(stderr, "SetFilePointer error: %lu\n", GetLastError()); + error_setg_win32(errp, GetLastError(), "SetFilePointer error"); return -EIO; } if (SetEndOfFile(s->hfile) == 0) { - fprintf(stderr, "SetEndOfFile error: %lu\n", GetLastError()); + error_setg_win32(errp, GetLastError(), "SetEndOfFile error"); return -EIO; } return 0; |