Fix more compilation errors

This commit is contained in:
Jakub Konka 2020-06-29 18:28:28 +02:00
parent b96882c57a
commit 5bc99dd7e8
2 changed files with 5 additions and 0 deletions

View File

@ -4012,6 +4012,7 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[MAX_PATH_BYTES]u8) RealP
if (builtin.os.tag == .linux and !builtin.link_libc) {
const fd = openZ(pathname, linux.O_PATH | linux.O_NONBLOCK | linux.O_CLOEXEC, 0) catch |err| switch (err) {
error.FileLocksNotSupported => unreachable,
error.NotCapable => unreachable, // WASI only
else => |e| return e,
};
defer close(fd);

View File

@ -499,6 +499,7 @@ pub const NativeTargetInfo = struct {
error.PipeBusy => unreachable,
error.FileLocksNotSupported => unreachable,
error.WouldBlock => unreachable,
error.NotCapable => unreachable, // we don't support WASI here (not yet at least)
error.IsDir,
error.NotDir,
@ -790,6 +791,7 @@ pub const NativeTargetInfo = struct {
var it = mem.tokenize(rpath_list, ":");
while (it.next()) |rpath| {
var dir = fs.cwd().openDir(rpath, .{}) catch |err| switch (err) {
error.NotCapable => unreachable, // we don't support WASI here (not yet at least)
error.NameTooLong => unreachable,
error.InvalidUtf8 => unreachable,
error.BadPathName => unreachable,
@ -817,6 +819,7 @@ pub const NativeTargetInfo = struct {
&link_buf,
) catch |err| switch (err) {
error.NameTooLong => unreachable,
error.NotCapable => unreachable, // we don't support WASI here (not yet at least)
error.AccessDenied,
error.FileNotFound,
@ -851,6 +854,7 @@ pub const NativeTargetInfo = struct {
const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
error.OperationAborted => unreachable, // Windows-only
error.WouldBlock => unreachable, // Did not request blocking mode
error.NotCapable => unreachable, // WASI only, and we don't support it here yet
error.SystemResources => return error.SystemResources,
error.IsDir => return error.UnableToReadElfFile,
error.BrokenPipe => return error.UnableToReadElfFile,