mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 17:25:21 +00:00
Add support for futimens for platforms that don't support futimes.
Patch by pashev.igor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185601 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -626,11 +626,21 @@ error_code permissions(const Twine &path, perms prms) {
|
||||
}
|
||||
|
||||
error_code setLastModificationAndAccessTime(int FD, TimeValue Time) {
|
||||
#if HAVE_FUTIMENS
|
||||
timespec Times[2];
|
||||
Times[0].tv_sec = Time.toPosixTime();
|
||||
Times[0].tv_nsec = 0;
|
||||
Times[1] = Times[0];
|
||||
if (::futimens(FD, Times))
|
||||
#elif HAVE_FUTIMES
|
||||
timeval Times[2];
|
||||
Times[0].tv_sec = Time.toPosixTime();
|
||||
Times[0].tv_usec = 0;
|
||||
Times[1] = Times[0];
|
||||
if (::futimes(FD, Times))
|
||||
#else
|
||||
#error Missing futimes() and futimens()
|
||||
#endif
|
||||
return error_code(errno, system_category());
|
||||
return error_code::success();
|
||||
}
|
||||
|
Reference in New Issue
Block a user