Fix compile errors in stage2

master
LeRoyce Pearson 2020-04-02 23:39:25 -06:00
parent ea6525797d
commit 733f1c25bd
7 changed files with 13 additions and 9 deletions

View File

@ -357,6 +357,7 @@ pub const ChildProcess = struct {
error.NoSpaceLeft => unreachable,
error.FileTooBig => unreachable,
error.DeviceBusy => unreachable,
error.FileLocksNotSupported => unreachable,
else => |e| return e,
}
else

View File

@ -843,6 +843,7 @@ pub const Dir = struct {
error.IsDir => unreachable, // we're providing O_DIRECTORY
error.NoSpaceLeft => unreachable, // not providing O_CREAT
error.PathAlreadyExists => unreachable, // not providing O_CREAT
error.FileLocksNotSupported => unreachable, // locking folders is not supported
else => |e| return e,
};
return Dir{ .fd = fd };

View File

@ -819,26 +819,34 @@ pub const OpenError = error{
SystemFdQuotaExceeded,
NoDevice,
FileNotFound,
/// The path exceeded `MAX_PATH_BYTES` bytes.
NameTooLong,
/// Insufficient kernel memory was available, or
/// the named file is a FIFO and per-user hard limit on
/// memory allocation for pipes has been reached.
SystemResources,
/// The file is too large to be opened. This error is unreachable
/// for 64-bit targets, as well as when opening directories.
FileTooBig,
/// The path refers to directory but the `O_DIRECTORY` flag was not provided.
IsDir,
/// A new path cannot be created because the device has no room for the new file.
/// This error is only reachable when the `O_CREAT` flag is provided.
NoSpaceLeft,
/// A component used as a directory in the path was not, in fact, a directory, or
/// `O_DIRECTORY` was specified and the path was not a directory.
NotDir,
/// The path already exists and the `O_CREAT` and `O_EXCL` flags were provided.
PathAlreadyExists,
DeviceBusy,
/// The underlying filesystem does not support file locks
FileLocksNotSupported,
} || UnexpectedError;

View File

@ -468,9 +468,8 @@ pub const NativeTargetInfo = struct {
error.InvalidUtf8 => unreachable,
error.BadPathName => unreachable,
error.PipeBusy => unreachable,
error.PermissionDenied => unreachable,
error.FileBusy => unreachable,
error.Locked => unreachable,
error.FileLocksNotSupported => unreachable,
error.WouldBlock => unreachable,
error.IsDir,
error.NotDir,

View File

@ -115,7 +115,6 @@ const Error = extern enum {
InvalidOperatingSystemVersion,
UnknownClangOption,
NestedResponseFile,
PermissionDenied,
FileBusy,
Locked,
};
@ -849,9 +848,7 @@ export fn stage2_libc_parse(stage1_libc: *Stage2LibCInstallation, libc_file_z: [
error.NoDevice => return .NoDevice,
error.NotDir => return .NotDir,
error.DeviceBusy => return .DeviceBusy,
error.PermissionDenied => return .PermissionDenied,
error.FileBusy => return .FileBusy,
error.Locked => return .Locked,
error.FileLocksNotSupported => unreachable,
};
stage1_libc.initFromStage2(libc);
return .None;

View File

@ -85,7 +85,6 @@ const char *err_str(Error err) {
case ErrorInvalidOperatingSystemVersion: return "invalid operating system version";
case ErrorUnknownClangOption: return "unknown Clang option";
case ErrorNestedResponseFile: return "nested response file";
case ErrorPermissionDenied: return "permission is denied";
case ErrorFileBusy: return "file is busy";
case ErrorLocked: return "file is locked by another process";
}

View File

@ -107,7 +107,6 @@ enum Error {
ErrorInvalidOperatingSystemVersion,
ErrorUnknownClangOption,
ErrorNestedResponseFile,
ErrorPermissionDenied,
ErrorFileBusy,
ErrorLocked,
};