mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
std: add missing error to windows.WriteFile
I encountered this error today when testing the self-hosted compiler on Windows.
This commit is contained in:
parent
44a6172edb
commit
a82d7c2063
@ -953,6 +953,10 @@ pub const WriteError = error{
|
||||
OperationAborted,
|
||||
NotOpenForWriting,
|
||||
|
||||
/// The process cannot access the file because another process has locked
|
||||
/// a portion of the file. Windows-only.
|
||||
LockViolation,
|
||||
|
||||
/// This error occurs when no global event loop is configured,
|
||||
/// and reading from the file descriptor would block.
|
||||
WouldBlock,
|
||||
|
||||
@ -517,6 +517,9 @@ pub const WriteFileError = error{
|
||||
OperationAborted,
|
||||
BrokenPipe,
|
||||
NotOpenForWriting,
|
||||
/// The process cannot access the file because another process has locked
|
||||
/// a portion of the file.
|
||||
LockViolation,
|
||||
Unexpected,
|
||||
};
|
||||
|
||||
@ -597,6 +600,7 @@ pub fn WriteFile(
|
||||
.IO_PENDING => unreachable,
|
||||
.BROKEN_PIPE => return error.BrokenPipe,
|
||||
.INVALID_HANDLE => return error.NotOpenForWriting,
|
||||
.LOCK_VIOLATION => return error.LockViolation,
|
||||
else => |err| return unexpectedError(err),
|
||||
}
|
||||
}
|
||||
|
||||
@ -435,6 +435,7 @@ pub const File = struct {
|
||||
EmitFail,
|
||||
NameTooLong,
|
||||
CurrentWorkingDirectoryUnlinked,
|
||||
LockViolation,
|
||||
};
|
||||
|
||||
/// Called from within the CodeGen to lower a local variable instantion as an unnamed
|
||||
|
||||
@ -4227,6 +4227,7 @@ const FmtError = error{
|
||||
NotOpenForWriting,
|
||||
UnsupportedEncoding,
|
||||
ConnectionResetByPeer,
|
||||
LockViolation,
|
||||
} || fs.File.OpenError;
|
||||
|
||||
fn fmtPath(fmt: *Fmt, file_path: []const u8, check_mode: bool, dir: fs.Dir, sub_path: []const u8) FmtError!void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user