commit ea90e6df98e7075b14eee3bbe67338cac5a12e43
parent 580e6be72c814c4943f6ba65e2329d14be660ee7
Author: Eyal Sawady <ecs@d2evs.net>
Date: Fri, 15 Oct 2021 09:59:33 +0000
unix::umask: don't return an error
According ot umask(2), "This system call always succeeds and the
previous value of the mask is returned."
Signed-off-by: Eyal Sawady <ecs@d2evs.net>
Diffstat:
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/unix/+linux/umask.ha b/unix/+linux/umask.ha
@@ -4,11 +4,4 @@ use rt;
// Sets the file mode creation mask for the current process and return the
// previous value of the mask.
-export fn umask(mode: fs::mode) (fs::mode | errors::error) = {
- match (rt::umask(mode)) {
- case mode: rt::mode_t =>
- return mode: fs::mode;
- case err: rt::errno =>
- return errors::errno(err);
- };
-};
+export fn umask(mode: fs::mode) fs::mode = rt::umask(mode)!: fs::mode;