Skip to content

Commit

Permalink
GVFS: can't open file (fix #142481) (#142499)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored Feb 8, 2022
1 parent 3390b24 commit 050f4a0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vs/platform/files/node/diskFileSystemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple

let bytesRead: number | null = null;
try {
const { bytesRead } = await Promises.read(fd, data, offset, length, normalizedPos);

return bytesRead;
bytesRead = (await Promises.read(fd, data, offset, length, normalizedPos)).bytesRead;
} catch (error) {
throw this.toFileSystemProviderError(error);
} finally {
this.updatePos(fd, normalizedPos, bytesRead);
}

return bytesRead;
}

private normalizePos(fd: number, pos: number): number | null {
Expand Down Expand Up @@ -465,14 +465,14 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple

let bytesWritten: number | null = null;
try {
const { bytesWritten } = await Promises.write(fd, data, offset, length, normalizedPos);

return bytesWritten;
bytesWritten = (await Promises.write(fd, data, offset, length, normalizedPos)).bytesWritten;
} catch (error) {
throw await this.toFileSystemProviderWriteError(this.writeHandles.get(fd), error);
} finally {
this.updatePos(fd, normalizedPos, bytesWritten);
}

return bytesWritten;
}

//#endregion
Expand Down

0 comments on commit 050f4a0

Please sign in to comment.