[libcxx] r351226 - Fix size_t/off_t mixup in std::filesystem.
Dan Albert
danalbert at google.com
Tue Jan 15 11:16:25 PST 2019
Author: danalbert
Date: Tue Jan 15 11:16:25 2019
New Revision: 351226
URL: http://llvm.org/viewvc/llvm-project?rev=351226&view=rev
Log:
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
Modified:
libcxx/trunk/src/filesystem/operations.cpp
Modified: libcxx/trunk/src/filesystem/operations.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/filesystem/operations.cpp?rev=351226&r1=351225&r2=351226&view=diff
==============================================================================
--- libcxx/trunk/src/filesystem/operations.cpp (original)
+++ libcxx/trunk/src/filesystem/operations.cpp Tue Jan 15 11:16:25 2019
@@ -439,7 +439,8 @@ file_status posix_lstat(path const& p, e
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;
More information about the libcxx-commits
mailing list