diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-30 16:58:32 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-30 16:58:32 -0500 |
| commit | 034ccb4e4e64dda2626535d46a4bc0367bcc1ad2 (patch) | |
| tree | 494d551fc7864bbf9f750a24d1f22b593a2ec9db /lib/std/os.zig | |
| parent | 413f9a5cfc9e867e3bc69b47b38c62b52a52d5e9 (diff) | |
| download | zig-034ccb4e4e64dda2626535d46a4bc0367bcc1ad2.tar.gz zig-034ccb4e4e64dda2626535d46a4bc0367bcc1ad2.zip | |
add missing error code handling on Windows
Diffstat (limited to 'lib/std/os.zig')
| -rw-r--r-- | lib/std/os.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index 6572d37305..622aaaf3bd 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2028,7 +2028,10 @@ pub fn waitpid(pid: i32, flags: u32) u32 { } } -pub const FStatError = error{SystemResources} || UnexpectedError; +pub const FStatError = error{ + SystemResources, + AccessDenied, +} || UnexpectedError; pub fn fstat(fd: fd_t) FStatError!Stat { var stat: Stat = undefined; @@ -2038,6 +2041,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat { EINVAL => unreachable, EBADF => unreachable, // Always a race condition. ENOMEM => return error.SystemResources, + EACCES => return error.AccessDenied, else => |err| return unexpectedErrno(err), } } @@ -2047,6 +2051,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat { EINVAL => unreachable, EBADF => unreachable, // Always a race condition. ENOMEM => return error.SystemResources, + EACCES => return error.AccessDenied, else => |err| return unexpectedErrno(err), } } |
