io: ignore failed zero length posixed mapped_files

This commit is contained in:
Danny Robson 2016-04-27 17:02:27 +10:00
parent cc001c4788
commit ddfb765110

View File

@ -29,7 +29,13 @@ using util::detail::posix::mapped_file;
mapped_file::mapped_file (const char *_path, int fflags, int mflags):
m_fd (_path, fflags)
{
load_fd (mflags);
try {
load_fd (mflags);
} catch (const errno_error &e) {
// ignore zero length mapping error
if (e.code () == EINVAL && m_size == 0)
return;
}
}