mirror of
https://github.com/boostorg/beast.git
synced 2025-08-05 15:54:46 +02:00
Tidy up file_stdio for VS2015
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
Version 243:
|
Version 243:
|
||||||
|
|
||||||
* Fix some typos
|
* Fix some typos
|
||||||
|
* Tidy up file_stdio for VS2015
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -104,13 +104,21 @@ open(char const* path, file_mode mode, error_code& ec)
|
|||||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
||||||
FILE* f0;
|
FILE* f0;
|
||||||
auto const ev = ::fopen_s(&f0, path, "rb");
|
auto const ev = ::fopen_s(&f0, path, "rb");
|
||||||
if(ev)
|
if(! ev)
|
||||||
|
{
|
||||||
|
std::fclose(f0);
|
||||||
|
ec = make_error_code(errc::file_exists);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if(ev !=
|
||||||
|
errc::no_such_file_or_directory)
|
||||||
{
|
{
|
||||||
ec.assign(ev, generic_category());
|
ec.assign(ev, generic_category());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
s = "wb";
|
s = "wb";
|
||||||
#else
|
#else
|
||||||
|
|
||||||
s = "wbx";
|
s = "wbx";
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@@ -163,7 +163,7 @@ test_file()
|
|||||||
error_code ec;
|
error_code ec;
|
||||||
BEAST_EXPECT(! fs::exists(path));
|
BEAST_EXPECT(! fs::exists(path));
|
||||||
f.open(path, file_mode::write_new, ec);
|
f.open(path, file_mode::write_new, ec);
|
||||||
BEAST_EXPECT(! ec);
|
BEAST_EXPECTS(! ec, ec.message());
|
||||||
BEAST_EXPECT(fs::exists(path));
|
BEAST_EXPECT(fs::exists(path));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user