aboutsummaryrefslogtreecommitdiff
path: root/block/file-win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/file-win32.c')
-rw-r--r--block/file-win32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/file-win32.c b/block/file-win32.c
index e132ba17da..7872e00a21 100644
--- a/block/file-win32.c
+++ b/block/file-win32.c
@@ -460,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;
@@ -475,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;