aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2019-01-15 19:16:25 +0000
committerDan Albert <danalbert@google.com>2019-01-15 19:16:25 +0000
commit45b511fb05f9073d72c1511bebd772f8e9dd6f35 (patch)
treeffcc02a04ef199f0fac54169058ea69bafe1b2be
parent5452d3f0995594ad048e7907b980a6c7f04a7e25 (diff)
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
-rw-r--r--libcxx/src/filesystem/operations.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index e3bbc7b64b88..b41061888724 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -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;