diff options
author | Jordan Rupprecht <rupprecht@google.com> | 2018-08-13 23:03:45 +0000 |
---|---|---|
committer | Jordan Rupprecht <rupprecht@google.com> | 2018-08-13 23:03:45 +0000 |
commit | 97ea485041c49fdfe0c3bac95d88753b4a461144 (patch) | |
tree | 68d61abb6737c0015297c7811ecc05a53d0cf919 /llvm/unittests/Support/Path.cpp | |
parent | 90bffb3eb98fea5730e33a8aa9a56369ffbed4c9 (diff) | |
download | bcm5719-llvm-97ea485041c49fdfe0c3bac95d88753b4a461144.tar.gz bcm5719-llvm-97ea485041c49fdfe0c3bac95d88753b4a461144.zip |
[Support] NFC: Allow modifying access/modification times independently in sys::fs::setLastModificationAndAccessTime.
Summary:
Add an overload to sys::fs::setLastModificationAndAccessTime that allows setting last access and modification times separately. This will allow tools to use this API when they want to preserve both the access and modification times from an input file, which may be different.
Also note that both the POSIX (futimens/futimes) and Windows (SetFileTime) APIs take the two timestamps in the order of (1) access (2) modification time, so this renames the method to "setLastAccessAndModificationTime" to make it clear which timestamp is which.
For existing callers, the 1-arg overload just sets both timestamps to the same thing.
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50521
llvm-svn: 339628
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r-- | llvm/unittests/Support/Path.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 158d6cfa3c3..02076726b15 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -1297,7 +1297,7 @@ TEST_F(FileSystemTest, OpenFileForRead) { ASSERT_NO_ERROR(sys::fs::openFileForWrite(Twine(TempPath), FileDescriptor, fs::CD_OpenExisting)); TimePoint<> Epoch(std::chrono::milliseconds(0)); - ASSERT_NO_ERROR(fs::setLastModificationAndAccessTime(FileDescriptor, Epoch)); + ASSERT_NO_ERROR(fs::setLastAccessAndModificationTime(FileDescriptor, Epoch)); ::close(FileDescriptor); // Open the file and ensure access time is updated, when forced. |