Skip to content

Commit d362b72

Browse files
authored
[WasmFS] Simplify read/write in the Node backend. NFC (#26595)
In line with commit c77be74. Split out from #24733.
1 parent fdd5762 commit d362b72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/libwasmfs_node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ addToLibrary({
206206
return wasmfsTry(() => {
207207
// TODO: Cache open file descriptors to guarantee that opened files will
208208
// still exist when we try to access them.
209-
let nread = fs.readSync(fd, new Int8Array(HEAPU8.buffer, buf_p, len), 0, len, pos);
209+
let nread = fs.readSync(fd, HEAPU8, buf_p, len, pos);
210210
{{{ makeSetValue('nread_p', 0, 'nread', 'i32') }}};
211211
// implicitly return 0
212212
});
@@ -217,7 +217,7 @@ addToLibrary({
217217
return wasmfsTry(() => {
218218
// TODO: Cache open file descriptors to guarantee that opened files will
219219
// still exist when we try to access them.
220-
let nwritten = fs.writeSync(fd, new Int8Array(HEAPU8.buffer, buf_p, len), 0, len, pos);
220+
let nwritten = fs.writeSync(fd, HEAPU8, buf_p, len, pos);
221221
{{{ makeSetValue('nwritten_p', 0, 'nwritten', 'i32') }}};
222222
// implicitly return 0
223223
});

0 commit comments

Comments
 (0)