os.dup2: handle EBAF

This commit is contained in:
Andrew Kelley 2019-10-24 21:13:05 -04:00
parent f6367a0751
commit 55c282ed51
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -663,7 +663,8 @@ pub fn dup2(old_fd: fd_t, new_fd: fd_t) !void {
0 => return,
EBUSY, EINTR => continue,
EMFILE => return error.ProcessFdQuotaExceeded,
EINVAL => unreachable,
EINVAL => unreachable, // invalid parameters passed to dup2
EBADF => unreachable, // always a race condition
else => |err| return unexpectedErrno(err),
}
}