summaryrefslogtreecommitdiffstats
path: root/lib/Archive/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Archive/Archive.cpp')
-rw-r--r--lib/Archive/Archive.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 3bb9a05..d5b56ca 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -137,8 +137,12 @@ Archive::Archive(const sys::Path& filename, bool map )
symTabSize(0), firstFileOffset(0), modules(), foreignST(0)
{
if (map) {
- mapfile = new sys::MappedFile(filename);
- base = (char*) mapfile->map();
+ std::string ErrMsg;
+ mapfile = new sys::MappedFile();
+ if (mapfile->open(filename, sys::MappedFile::READ_ACCESS, &ErrMsg))
+ throw ErrMsg;
+ if (!(base = (char*) mapfile->map(&ErrMsg)))
+ throw ErrMsg;
}
}