authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-27 17:17:24-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-27 17:17:24-04:00
logdc299166cfb2d9476ce5c86ca361a065935c4e7e
tree945b1f10eae24c70eebd1f0fffc4afdd704f4032
parent878aece87b11e112b2ab890aa5242d8c472864a5
signaturelock-open Commit is signed but in an unrecognized format.

std.os.fstat: EINVAL => unreachable

Related: #3291

1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/os.zig+2
...@@ -1834,6 +1834,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {...@@ -1834,6 +1834,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {
1834 if (darwin.is_the_target) {1834 if (darwin.is_the_target) {
1835 switch (darwin.getErrno(darwin.@"fstat$INODE64"(fd, &stat))) {1835 switch (darwin.getErrno(darwin.@"fstat$INODE64"(fd, &stat))) {
1836 0 => return stat,1836 0 => return stat,
1837 EINVAL => unreachable,
1837 EBADF => unreachable, // Always a race condition.1838 EBADF => unreachable, // Always a race condition.
1838 ENOMEM => return error.SystemResources,1839 ENOMEM => return error.SystemResources,
1839 else => |err| return unexpectedErrno(err),1840 else => |err| return unexpectedErrno(err),
...@@ -1842,6 +1843,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {...@@ -1842,6 +1843,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {
18421843
1843 switch (errno(system.fstat(fd, &stat))) {1844 switch (errno(system.fstat(fd, &stat))) {
1844 0 => return stat,1845 0 => return stat,
1846 EINVAL => unreachable,
1845 EBADF => unreachable, // Always a race condition.1847 EBADF => unreachable, // Always a race condition.
1846 ENOMEM => return error.SystemResources,1848 ENOMEM => return error.SystemResources,
1847 else => |err| return unexpectedErrno(err),1849 else => |err| return unexpectedErrno(err),