1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:07:36 +00:00

strace: Interpret errno codes for pointer-like return codes

This commit is contained in:
Ben Wiederhake 2021-11-07 15:01:59 +01:00 committed by Andreas Kling
parent 81b6be4bf4
commit 4512e89159

View file

@ -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()