Loading block/raw-win32.c +14 −3 Original line number Diff line number Diff line Loading @@ -303,13 +303,24 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset) { BDRVRawState *s = bs->opaque; LONG low, high; DWORD dwPtrLow; low = offset; high = offset >> 32; if (!SetFilePointer(s->hfile, low, &high, FILE_BEGIN)) /* * An error has occurred if the return value is INVALID_SET_FILE_POINTER * and GetLastError doesn't return NO_ERROR. */ dwPtrLow = SetFilePointer(s->hfile, low, &high, FILE_BEGIN); if (dwPtrLow == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) { fprintf(stderr, "SetFilePointer error: %d\n", GetLastError()); return -EIO; if (!SetEndOfFile(s->hfile)) } if (SetEndOfFile(s->hfile) == 0) { fprintf(stderr, "SetEndOfFile error: %d\n", GetLastError()); return -EIO; } return 0; } Loading Loading
block/raw-win32.c +14 −3 Original line number Diff line number Diff line Loading @@ -303,13 +303,24 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset) { BDRVRawState *s = bs->opaque; LONG low, high; DWORD dwPtrLow; low = offset; high = offset >> 32; if (!SetFilePointer(s->hfile, low, &high, FILE_BEGIN)) /* * An error has occurred if the return value is INVALID_SET_FILE_POINTER * and GetLastError doesn't return NO_ERROR. */ dwPtrLow = SetFilePointer(s->hfile, low, &high, FILE_BEGIN); if (dwPtrLow == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) { fprintf(stderr, "SetFilePointer error: %d\n", GetLastError()); return -EIO; if (!SetEndOfFile(s->hfile)) } if (SetEndOfFile(s->hfile) == 0) { fprintf(stderr, "SetEndOfFile error: %d\n", GetLastError()); return -EIO; } return 0; } Loading