summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-02-13 19:46:49 +0530
committerGitHub <noreply@github.com>2024-02-13 19:46:49 +0530
commit492a9fbb9194a24a1f9223f797b4f4df9efde2bd (patch)
tree8de287bcddcfb9c9f6709eeeabf31b1b10d063ff
parent92f61882531a0dfa2bd57ab0804daec88721760b (diff)
fix(ext/node): export process.umask (#22348)
Fixes https://github.com/denoland/deno/issues/20914
-rw-r--r--ext/node/polyfills/process.ts9
1 files changed, 9 insertions, 0 deletions
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();
};