std.os: update error set for setsockopt

This commit is contained in:
Luna 2019-12-30 12:41:23 -03:00 committed by Andrew Kelley
parent 0d852effe3
commit 22f6297157
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -3257,13 +3257,10 @@ pub fn setsockopt(fd: fd_t, level: u32, optname: u32, opt: []const u8) !void {
0 => {},
EBADF => unreachable,
EINVAL => unreachable,
EDOM => return error.TimeoutTooBig,
EFAULT => unreachable,
EISCONN => return error.AlreadyConnected,
ENOPROTOOPT => return error.InvalidProtocolOption,
ENOTSOCK => return error.NotSocket,
ENOMEM => return error.OutOfMemory,
ENOBUFS => return error.SystemResources,
else => |err| return std.os.unexpectedErrno(err),
ENOTSOCK => unreachable,
else => |err| return unexpectedErrno(err),
}
}