Change Unsupported to InterfaceNotFound

master
Luna 2020-03-30 16:05:22 -03:00 committed by Andrew Kelley
parent 38109d48a3
commit c50ac9a764
1 changed files with 5 additions and 2 deletions

View File

@ -542,14 +542,17 @@ fn if_nametoindex(name: []const u8) !u32 {
switch (os.errno(rc)) {
os.EBADF => return error.BadFile,
os.EINTR => return error.CaughtSignal,
os.EINVAL => unreachable,
os.EIO => return error.FileSystem,
os.EINVAL => unreachable,
os.ENOTTY => unreachable,
os.ENXIO => unreachable,
os.ENODEV => return error.Unsupported,
// ioctl() sends ENODEV for an unknown scope id.
os.ENODEV => return error.InterfaceNotFound,
else => {},
}
std.debug.warn("ival={}\n", .{ifr.ifr_ifru.ifru_ivalue});
return @bitCast(u32, ifr.ifr_ifru.ifru_ivalue);
}