io_win32: use try_func when dispatching mapped_file

This commit is contained in:
Danny Robson 2018-08-14 16:48:20 +10:00
parent d8f916a25b
commit 2eb1f2b919

View File

@ -110,13 +110,16 @@ mapped_file::mapped_file (::cruft::win32::handle &&src,
//-----------------------------------------------------------------------------
mapped_file::mapped_file (const std::experimental::filesystem::path &path,
mapped_file::mapped_file (
std::experimental::filesystem::path const &path,
int fflags,
int mflags):
mapped_file (
int mflags
)
: mapped_file (
::cruft::win32::handle (
::CreateFile (
path.string ().c_str (),
::cruft::win32::error::try_call (
::CreateFile,
path.u8string ().c_str (),
fflags_to_generic (fflags),
fflags == O_RDONLY ? FILE_SHARE_READ : 0,
nullptr,
@ -127,7 +130,7 @@ mapped_file::mapped_file (const std::experimental::filesystem::path &path,
),
fflags,
mflags
)
)
{ ; }