LibCore: Fix build error in File.cpp on macOS

struct stat on macOS doesn't have st_atim.tv_sec and therefore broke the
Lagom build. Replacing it with st_atime fixes that.
This commit is contained in:
fladd 2021-08-18 23:09:22 +02:00 committed by Linus Groh
parent ee608f58ee
commit 1de104c6c4
Notes: sideshowbarker 2024-07-18 05:28:50 +09:00

View File

@ -481,8 +481,8 @@ Result<void, File::CopyError> File::copy_directory(String const& dst_path, Strin
// FIXME: Implement utimens() and use it here.
struct utimbuf timbuf;
timbuf.actime = src_stat.st_atim.tv_sec;
timbuf.modtime = src_stat.st_atim.tv_sec;
timbuf.actime = src_stat.st_atime;
timbuf.modtime = src_stat.st_atime;
if (utime(dst_path.characters(), &timbuf) < 0)
return CopyError { OSError(errno), false };
}