strace: Interpret errno codes for pointer-like return codes
This commit is contained in:
parent
81b6be4bf4
commit
4512e89159
Notes:
sideshowbarker
2024-07-18 01:19:29 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/4512e891595 Pull-request: https://github.com/SerenityOS/serenity/pull/10838
1 changed files with 6 additions and 1 deletions
|
@ -386,7 +386,12 @@ public:
|
|||
|
||||
void format_result(void* res)
|
||||
{
|
||||
m_builder.appendff(") = {}\n", res);
|
||||
if (res == MAP_FAILED)
|
||||
m_builder.append(") = MAP_FAILED\n");
|
||||
else if (FlatPtr(res) > FlatPtr(-EMAXERRNO))
|
||||
m_builder.appendff(") = {} {}\n", res, errno_name(-static_cast<int>(FlatPtr(res))));
|
||||
else
|
||||
m_builder.appendff(") = {}\n", res);
|
||||
}
|
||||
|
||||
void format_result()
|
||||
|
|
Loading…
Add table
Reference in a new issue