zip: Use st_mtime to access mtimes

`st_mtime` is a define on modern POSIXes, for `st_mtim.tv_sec` on
e.g. Linux and for `st_mtimespec.tv_sec` on e.g. macOS.

No behavior change, but lets this file compile on macOS.
This commit is contained in:
Nico Weber committed 2026-02-16 19:04:49 -05:00
1 parent d6df443a5c
commit 883953b441
1 file changed
+2 -2
+2 -2
View File
@@ -55,7 +55,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto file = TRY(Core::File::open(path, Core::File::OpenMode::Read));
auto stat = TRY(Core::System::fstat(file->fd()));
auto date = Core::DateTime::from_timestamp(stat.st_mtim.tv_sec);
auto date = Core::DateTime::from_timestamp(stat.st_mtime);
auto information = TRY(zip_stream.add_member_from_stream(canonicalized_path, *file, date, stat.st_mode));
if (information.compression_ratio < 1.f) {
@@ -71,7 +71,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto canonicalized_path = TRY(String::formatted("{}/", LexicalPath::canonicalized_path(path)));
auto stat = TRY(Core::System::stat(path));
auto date = Core::DateTime::from_timestamp(stat.st_mtim.tv_sec);
auto date = Core::DateTime::from_timestamp(stat.st_mtime);
TRY(zip_stream.add_directory(canonicalized_path, date, stat.st_mode));
if (!recurse)