mirror of
https://github.com/vimpunk/mio.git
synced 2025-12-06 16:57:01 +08:00
Fix missing error code in conditional_sync
This commit is contained in:
parent
d33a0d567f
commit
0da3002815
@ -334,7 +334,7 @@ void basic_mmap<AccessMode, ByteT>::sync(std::error_code& error)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data() != nullptr)
|
if(data())
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if(::FlushViewOfFile(get_mapping_start(), mapped_length_) == 0
|
if(::FlushViewOfFile(get_mapping_start(), mapped_length_) == 0
|
||||||
|
|||||||
@ -372,7 +372,14 @@ private:
|
|||||||
*/
|
*/
|
||||||
template<access_mode A = AccessMode,
|
template<access_mode A = AccessMode,
|
||||||
typename = typename std::enable_if<A == access_mode::write>::type>
|
typename = typename std::enable_if<A == access_mode::write>::type>
|
||||||
void conditional_sync() { sync(); }
|
void conditional_sync()
|
||||||
|
{
|
||||||
|
// This is invoked from the destructor, so not much we can do about
|
||||||
|
// failures here.
|
||||||
|
std::error_code ec;
|
||||||
|
sync(ec);
|
||||||
|
}
|
||||||
|
|
||||||
template<access_mode A = AccessMode>
|
template<access_mode A = AccessMode>
|
||||||
typename std::enable_if<A == access_mode::read, void>::type conditional_sync() {}
|
typename std::enable_if<A == access_mode::read, void>::type conditional_sync() {}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user