std.os.fstat: EINVAL => unreachable

Related: #3291
master
Andrew Kelley 2019-09-27 17:17:24 -04:00
parent 878aece87b
commit dc299166cf
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 2 additions and 0 deletions

View File

@ -1834,6 +1834,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {
if (darwin.is_the_target) {
switch (darwin.getErrno(darwin.@"fstat$INODE64"(fd, &stat))) {
0 => return stat,
EINVAL => unreachable,
EBADF => unreachable, // Always a race condition.
ENOMEM => return error.SystemResources,
else => |err| return unexpectedErrno(err),
@ -1842,6 +1843,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {
switch (errno(system.fstat(fd, &stat))) {
0 => return stat,
EINVAL => unreachable,
EBADF => unreachable, // Always a race condition.
ENOMEM => return error.SystemResources,
else => |err| return unexpectedErrno(err),