diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-11-07 15:01:59 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-10 14:47:31 +0100 |
commit | 4512e891595580e36ad9093358f7baa0ea93b409 (patch) | |
tree | 76f2a665a5ed2efbb105cb35f2becb71f37f1eee | |
parent | 81b6be4bf4c65077d35a3446ba126586e86a85ea (diff) | |
download | serenity-4512e891595580e36ad9093358f7baa0ea93b409.zip |
strace: Interpret errno codes for pointer-like return codes
-rw-r--r-- | Userland/Utilities/strace.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Utilities/strace.cpp b/Userland/Utilities/strace.cpp index b640393188..b4669fd856 100644 --- a/Userland/Utilities/strace.cpp +++ b/Userland/Utilities/strace.cpp @@ -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() |