From 492a9fbb9194a24a1f9223f797b4f4df9efde2bd Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 13 Feb 2024 19:46:49 +0530 Subject: fix(ext/node): export process.umask (#22348) Fixes https://github.com/denoland/deno/issues/20914 --- ext/node/polyfills/process.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 20399bdf9..a8da35f70 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -97,6 +97,15 @@ export const exit = (code?: number | string) => { process.reallyExit(process.exitCode || 0); }; +/** https://nodejs.org/api/process.html#processumaskmask */ +export const umask = () => { + // Always return the system default umask value. + // We don't use Deno.umask here because it has a race + // condition bug. + // See https://github.com/denoland/deno_std/issues/1893#issuecomment-1032897779 + return 0o22; +}; + export const abort = () => { op_process_abort(); }; -- cgit v1.2.3