diff options
Diffstat (limited to 'lib/System/Unix')
-rw-r--r-- | lib/System/Unix/MappedFile.cpp | 3 | ||||
-rw-r--r-- | lib/System/Unix/MappedFile.inc | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/System/Unix/MappedFile.cpp b/lib/System/Unix/MappedFile.cpp index 7e03cd15a8..0e03a04c6f 100644 --- a/lib/System/Unix/MappedFile.cpp +++ b/lib/System/Unix/MappedFile.cpp @@ -53,6 +53,8 @@ void MappedFile::initialize() { info_ = 0; ThrowErrno(std::string("Can't stat file: ") + path_.get()); } + } else { + throw std::string("Can't open file: ") + path_.get(); } } @@ -74,6 +76,7 @@ void MappedFile::unmap() { } void* MappedFile::map() { + assert(info_ && "MappedFile not initialized"); if (!isMapped()) { int prot = PROT_NONE; int flags = 0; diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc index 7e03cd15a8..0e03a04c6f 100644 --- a/lib/System/Unix/MappedFile.inc +++ b/lib/System/Unix/MappedFile.inc @@ -53,6 +53,8 @@ void MappedFile::initialize() { info_ = 0; ThrowErrno(std::string("Can't stat file: ") + path_.get()); } + } else { + throw std::string("Can't open file: ") + path_.get(); } } @@ -74,6 +76,7 @@ void MappedFile::unmap() { } void* MappedFile::map() { + assert(info_ && "MappedFile not initialized"); if (!isMapped()) { int prot = PROT_NONE; int flags = 0; |