mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
Fix compile errors about adding error.FileLocksNotSupported
This commit is contained in:
parent
4dd0822a36
commit
ea32a7d2bc
@ -1550,7 +1550,7 @@ pub fn walkPath(allocator: *Allocator, dir_path: []const u8) !Walker {
|
||||
return walker;
|
||||
}
|
||||
|
||||
pub const OpenSelfExeError = os.OpenError || os.windows.CreateFileError || SelfExePathError || os.FcntlError;
|
||||
pub const OpenSelfExeError = os.OpenError || os.windows.CreateFileError || SelfExePathError || os.FlockError;
|
||||
|
||||
pub fn openSelfExe() OpenSelfExeError!File {
|
||||
if (builtin.os.tag == .linux) {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user