forked from OSchip/llvm-project
Fix size_t/off_t mixup in std::filesystem.
Summary: ftruncate takes an off_t, not a size_t. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: christof, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D56578 llvm-svn: 351226
This commit is contained in:
parent
5452d3f099
commit
45b511fb05
|
@ -439,7 +439,8 @@ file_status posix_lstat(path const& p, error_code* ec) {
|
|||
return posix_lstat(p, path_stat, ec);
|
||||
}
|
||||
|
||||
bool posix_ftruncate(const FileDescriptor& fd, size_t to_size, error_code& ec) {
|
||||
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html
|
||||
bool posix_ftruncate(const FileDescriptor& fd, off_t to_size, error_code& ec) {
|
||||
if (::ftruncate(fd.fd, to_size) == -1) {
|
||||
ec = capture_errno();
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue