Skip to content

Commit 482ce86

Browse files
committed
set appropriate error_code when failing due to lack of fstream
1 parent 55fe8ca commit 482ce86

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcxx/src/filesystem/operations.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <filesystem>
1616
#include <iterator>
1717
#include <string_view>
18+
#include <system_error>
1819
#include <type_traits>
1920
#include <vector>
2021

@@ -321,6 +322,7 @@ bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_cod
321322
return copy_file_impl_fstream(read_fd, write_fd, ec);
322323
# else
323324
// since iostreams are unavailable in the no-locale build, just fail after a failed sendfile
325+
ec.assign(EINVAL, std::system_category());
324326
return false;
325327
# endif
326328
}

0 commit comments

Comments
 (0)