From ea32a7d2bc395b268e7e5be4fccb3cdb91233e78 Mon Sep 17 00:00:00 2001 From: LeRoyce Pearson Date: Fri, 3 Apr 2020 00:27:34 -0600 Subject: Fix compile errors about adding error.FileLocksNotSupported --- lib/std/os.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/std/os.zig') diff --git a/lib/std/os.zig b/lib/std/os.zig index e0e998a4a6..1df22b0456 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -3295,7 +3295,10 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[MAX_PATH_BYTES]u8) RealP return realpathW(&pathname_w, out_buffer); } if (builtin.os.tag == .linux and !builtin.link_libc) { - const fd = try openZ(pathname, linux.O_PATH | linux.O_NONBLOCK | linux.O_CLOEXEC, 0); + const fd = openZ(pathname, linux.O_PATH | linux.O_NONBLOCK | linux.O_CLOEXEC, 0) catch |err| switch (err) { + error.FileLocksNotSupported => unreachable, + else => |e| return e, + }; defer close(fd); var procfs_buf: ["/proc/self/fd/-2147483648".len:0]u8 = undefined; -- cgit v1.2.3