mirror of
https://github.com/ziglang/zig.git
synced 2024-11-21 11:32:24 +00:00
Merge c9facf0ba3
into f845fa04a0
This commit is contained in:
commit
f14b1733d7
@ -507,6 +507,7 @@ pub const SelfExePathError = error{
|
||||
DeviceBusy,
|
||||
SharingViolation,
|
||||
PipeBusy,
|
||||
PipeNotAvailable,
|
||||
NotLink,
|
||||
PathAlreadyExists,
|
||||
|
||||
|
@ -39,6 +39,7 @@ pub const OpenError = error{
|
||||
FileNotFound,
|
||||
AccessDenied,
|
||||
PipeBusy,
|
||||
PipeNotAvailable,
|
||||
NameTooLong,
|
||||
/// WASI-only; file paths must be valid UTF-8.
|
||||
InvalidUtf8,
|
||||
|
@ -37,6 +37,7 @@ pub const OpenError = error{
|
||||
NoDevice,
|
||||
AccessDenied,
|
||||
PipeBusy,
|
||||
PipeNotAvailable,
|
||||
PathAlreadyExists,
|
||||
Unexpected,
|
||||
NameTooLong,
|
||||
@ -132,6 +133,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN
|
||||
.SHARING_VIOLATION => return error.AccessDenied,
|
||||
.ACCESS_DENIED => return error.AccessDenied,
|
||||
.PIPE_BUSY => return error.PipeBusy,
|
||||
.PIPE_NOT_AVAILABLE => return error.PipeNotAvailable,
|
||||
.OBJECT_PATH_SYNTAX_BAD => unreachable,
|
||||
.OBJECT_NAME_COLLISION => return error.PathAlreadyExists,
|
||||
.FILE_IS_A_DIRECTORY => return error.IsDir,
|
||||
@ -801,6 +803,7 @@ pub fn CreateSymbolicLink(
|
||||
error.NotDir => return error.Unexpected,
|
||||
error.WouldBlock => return error.Unexpected,
|
||||
error.PipeBusy => return error.Unexpected,
|
||||
error.PipeNotAvailable => return error.Unexpected,
|
||||
error.AntivirusInterference => return error.Unexpected,
|
||||
else => |e| return e,
|
||||
};
|
||||
@ -1335,6 +1338,7 @@ pub fn GetFinalPathNameByHandle(
|
||||
error.NoDevice => return error.Unexpected,
|
||||
error.AccessDenied => return error.Unexpected,
|
||||
error.PipeBusy => return error.Unexpected,
|
||||
error.PipeNotAvailable => return error.Unexpected,
|
||||
error.PathAlreadyExists => return error.Unexpected,
|
||||
error.WouldBlock => return error.Unexpected,
|
||||
error.NetworkNotFound => return error.Unexpected,
|
||||
|
@ -2574,6 +2574,7 @@ pub const RenameError = error{
|
||||
NoDevice,
|
||||
SharingViolation,
|
||||
PipeBusy,
|
||||
PipeNotAvailable,
|
||||
/// On Windows, `\\server` or `\\server\share` was not found.
|
||||
NetworkNotFound,
|
||||
/// On Windows, antivirus software is enabled by default. It can be
|
||||
@ -2945,6 +2946,7 @@ pub fn mkdiratW(dir_fd: fd_t, sub_path_w: []const u16, mode: u32) MakeDirError!v
|
||||
}) catch |err| switch (err) {
|
||||
error.IsDir => return error.Unexpected,
|
||||
error.PipeBusy => return error.Unexpected,
|
||||
error.PipeNotAvailable => return error.Unexpected,
|
||||
error.WouldBlock => return error.Unexpected,
|
||||
error.AntivirusInterference => return error.Unexpected,
|
||||
else => |e| return e,
|
||||
@ -3039,6 +3041,7 @@ pub fn mkdirW(dir_path_w: []const u16, mode: u32) MakeDirError!void {
|
||||
}) catch |err| switch (err) {
|
||||
error.IsDir => return error.Unexpected,
|
||||
error.PipeBusy => return error.Unexpected,
|
||||
error.PipeNotAvailable => return error.Unexpected,
|
||||
error.WouldBlock => return error.Unexpected,
|
||||
error.AntivirusInterference => return error.Unexpected,
|
||||
else => |e| return e,
|
||||
@ -5368,6 +5371,7 @@ pub const RealPathError = error{
|
||||
|
||||
SharingViolation,
|
||||
PipeBusy,
|
||||
PipeNotAvailable,
|
||||
|
||||
/// Windows-only; file paths provided by the user must be valid WTF-8.
|
||||
/// https://simonsapin.github.io/wtf-8/
|
||||
|
@ -746,6 +746,7 @@ fn spawnWindows(self: *ChildProcess) SpawnError!void {
|
||||
}) catch |err| switch (err) {
|
||||
error.PathAlreadyExists => return error.Unexpected, // not possible for "NUL"
|
||||
error.PipeBusy => return error.Unexpected, // not possible for "NUL"
|
||||
error.PipeNotAvailable => return error.Unexpected, // not possible for "NUL"
|
||||
error.FileNotFound => return error.Unexpected, // not possible for "NUL"
|
||||
error.AccessDenied => return error.Unexpected, // not possible for "NUL"
|
||||
error.NameTooLong => return error.Unexpected, // not possible for "NUL"
|
||||
|
@ -805,6 +805,7 @@ fn glibcVerFromRPath(rpath: []const u8) !std.SemanticVersion {
|
||||
error.InvalidWtf8 => unreachable, // Windows only
|
||||
error.BadPathName => unreachable, // Windows only
|
||||
error.PipeBusy => unreachable, // Windows-only
|
||||
error.PipeNotAvailable => unreachable, // Windows-only
|
||||
error.SharingViolation => unreachable, // Windows-only
|
||||
error.NetworkNotFound => unreachable, // Windows-only
|
||||
error.AntivirusInterference => unreachable, // Windows-only
|
||||
@ -1068,6 +1069,7 @@ fn detectAbiAndDynamicLinker(
|
||||
error.InvalidWtf8 => unreachable, // Windows only
|
||||
error.BadPathName => unreachable,
|
||||
error.PipeBusy => unreachable,
|
||||
error.PipeNotAvailable => unreachable,
|
||||
error.FileLocksNotSupported => unreachable,
|
||||
error.WouldBlock => unreachable,
|
||||
error.FileBusy => unreachable, // opened without write permissions
|
||||
|
@ -250,6 +250,7 @@ pub fn populateFile(comp: *Compilation, mod: *Module, file: *File) !void {
|
||||
error.BadPathName => unreachable, // it's always "builtin.zig"
|
||||
error.NameTooLong => unreachable, // it's always "builtin.zig"
|
||||
error.PipeBusy => unreachable, // it's not a pipe
|
||||
error.PipeNotAvailable => unreachable, // it's not a pipe
|
||||
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
||||
|
||||
error.FileNotFound => try writeFile(file, mod),
|
||||
|
@ -133,6 +133,7 @@ pub fn astGenFile(
|
||||
error.BadPathName => unreachable, // it's a hex encoded name
|
||||
error.NameTooLong => unreachable, // it's a fixed size name
|
||||
error.PipeBusy => unreachable, // it's not a pipe
|
||||
error.PipeNotAvailable => unreachable, // it's not a pipe
|
||||
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
||||
// There are no dir components, so you would think that this was
|
||||
// unreachable, however we have observed on macOS two processes racing
|
||||
|
Loading…
Reference in New Issue
Block a user