diff options
author | Jenkins nedprod CI <jenkins-nedprod@europe5.nedproductions.biz> | 2020-07-17 02:00:12 +0300 |
---|---|---|
committer | Jenkins nedprod CI <jenkins-nedprod@europe5.nedproductions.biz> | 2020-07-17 02:00:12 +0300 |
commit | 1151d7b47dc39a9ae9f68d08972628f3aa267025 (patch) | |
tree | 7f0cbac02c1bac6c1e9357198a3a20386cbf4f00 | |
parent | 7d731a07239454c3eb8f18e4c6674ab8873344d5 (diff) | |
parent | 751ce5021b4ad47258db1c8dc7c90ee9155a9211 (diff) |
Merged from develop branch as CDash reports all green
-rw-r--r-- | include/llfio/v2.0/detail/impl/posix/file_handle.ipp | 4 | ||||
-rw-r--r-- | include/llfio/v2.0/detail/impl/windows/file_handle.ipp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp index bdc57f25..59175770 100644 --- a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp +++ b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp @@ -434,6 +434,10 @@ result<file_handle::extent_pair> file_handle::clone_extents_to(file_handle::exte try { LLFIO_LOG_FUNCTION_CALL(this); + if(!dest_.is_writable()) + { + return errc::bad_file_descriptor; + } OUTCOME_TRY(auto mycurrentlength, maximum_extent()); if(extent.offset == (extent_type) -1 && extent.length == (extent_type) -1) { diff --git a/include/llfio/v2.0/detail/impl/windows/file_handle.ipp b/include/llfio/v2.0/detail/impl/windows/file_handle.ipp index 55154f4b..b9137ce8 100644 --- a/include/llfio/v2.0/detail/impl/windows/file_handle.ipp +++ b/include/llfio/v2.0/detail/impl/windows/file_handle.ipp @@ -410,6 +410,10 @@ result<file_handle::extent_pair> file_handle::clone_extents_to(file_handle::exte windows_nt_kernel::init(); using namespace windows_nt_kernel; LLFIO_LOG_FUNCTION_CALL(this); + if(!dest_.is_writable()) + { + return errc::bad_file_descriptor; + } OUTCOME_TRY(auto mycurrentlength, maximum_extent()); if(extent.offset == (extent_type) -1 && extent.length == (extent_type) -1) { |