mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
elide the 'ErrorInfo' in logError and logWarning calls
This commit is contained in:
parent
734283d636
commit
d82d230b40
11 changed files with 187 additions and 224 deletions
|
@ -39,19 +39,17 @@ std::set<std::string> runResolver(const Path & filename)
|
|||
throw SysError("statting '%s'", filename);
|
||||
|
||||
if (!S_ISREG(st.st_mode)) {
|
||||
logError(
|
||||
ErrorInfo {
|
||||
.name = "Regular MACH file",
|
||||
.hint = hintfmt("file '%s' is not a regular file", filename)
|
||||
logError({
|
||||
.name = "Regular MACH file",
|
||||
.hint = hintfmt("file '%s' is not a regular file", filename)
|
||||
});
|
||||
return {};
|
||||
}
|
||||
|
||||
if (st.st_size < sizeof(mach_header_64)) {
|
||||
logError(
|
||||
ErrorInfo {
|
||||
.name = "File too short",
|
||||
.hint = hintfmt("file '%s' is too short for a MACH binary", filename)
|
||||
logError({
|
||||
.name = "File too short",
|
||||
.hint = hintfmt("file '%s' is too short for a MACH binary", filename)
|
||||
});
|
||||
return {};
|
||||
}
|
||||
|
@ -74,20 +72,18 @@ std::set<std::string> runResolver(const Path & filename)
|
|||
}
|
||||
}
|
||||
if (mach64_offset == 0) {
|
||||
logError(
|
||||
ErrorInfo {
|
||||
.name = "No mach64 blobs",
|
||||
.hint = hintfmt("Could not find any mach64 blobs in file '%1%', continuing...", filename)
|
||||
logError({
|
||||
.name = "No mach64 blobs",
|
||||
.hint = hintfmt("Could not find any mach64 blobs in file '%1%', continuing...", filename)
|
||||
});
|
||||
return {};
|
||||
}
|
||||
} else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) {
|
||||
mach64_offset = 0;
|
||||
} else {
|
||||
logError(
|
||||
ErrorInfo {
|
||||
.name = "Magic number",
|
||||
.hint = hintfmt("Object file has unknown magic number '%1%', skipping it...", magic)
|
||||
logError({
|
||||
.name = "Magic number",
|
||||
.hint = hintfmt("Object file has unknown magic number '%1%', skipping it...", magic)
|
||||
});
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue