summaryrefslogtreecommitdiff
path: root/Userland/disasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/disasm.cpp')
-rw-r--r--Userland/disasm.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Userland/disasm.cpp b/Userland/disasm.cpp
index 4189499000..781caf0796 100644
--- a/Userland/disasm.cpp
+++ b/Userland/disasm.cpp
@@ -48,12 +48,14 @@ int main(int argc, char** argv)
args_parser.add_positional_argument(path, "Path to i386 binary file", "path");
args_parser.parse(argc, argv);
- MappedFile file(path);
- if (!file.is_valid()) {
- // Already printed some error message.
+ auto file_or_error = MappedFile::map(path);
+ if (file_or_error.is_error()) {
+ warnln("Could not map file: {}", file_or_error.error().string());
return 1;
}
+ auto& file = *file_or_error.value();
+
struct Symbol {
size_t value;
size_t size;