Skip to content

Commit

Permalink
Fix RIGHTS_FD_WRITE constant value used in consolePrinter
Browse files Browse the repository at this point in the history
The wrong value led `IO.open(1, "w")` to fail
  • Loading branch information
kateinoigakukun committed Jun 15, 2024
1 parent 4ff7c8d commit faa5102
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/npm-packages/ruby-wasm-wasi/src/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ export function consolePrinter(
view.setUint8(fs_filetypePtr, 2); // FILETYPE_CHARACTER_DEVICE

const fs_rights_basePtr = fdstat + 8;
view.setBigUint64(fs_rights_basePtr, BigInt(1)); // RIGHTS_FD_WRITE
// See https://github.com/WebAssembly/WASI/blob/v0.2.0/legacy/preview1/docs.md#record-members
const RIGHTS_FD_WRITE = 1 << 6;
view.setBigUint64(fs_rights_basePtr, BigInt(RIGHTS_FD_WRITE), true);

return 0;
};
Expand Down

0 comments on commit faa5102

Please sign in to comment.