Skip to content

Commit

Permalink
LibCore: Fix build error in File.cpp on macOS
Browse files Browse the repository at this point in the history
struct stat on macOS doesn't have st_atim.tv_sec and therefore broke the
Lagom build. Replacing it with st_atime fixes that.
  • Loading branch information
fladd authored and linusg committed Aug 19, 2021
1 parent ee608f5 commit 1de104c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Userland/Libraries/LibCore/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
Expand Down

0 comments on commit 1de104c

Please sign in to comment.