1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 10:25:10 +00:00

Kernel: Use AK::Time for InodeMetadata timestamps instead of time_t

Before this change, we were truncating the nanosecond part of file
timestamps in many different places.
This commit is contained in:
Andreas Kling 2022-11-22 21:01:45 +01:00
parent f8290e1ad4
commit 10fa72d451
23 changed files with 56 additions and 58 deletions

View file

@ -140,7 +140,7 @@ ErrorOr<void> ISO9660Inode::truncate(u64)
return EROFS;
}
ErrorOr<void> ISO9660Inode::update_timestamps(Optional<time_t>, Optional<time_t>, Optional<time_t>)
ErrorOr<void> ISO9660Inode::update_timestamps(Optional<Time>, Optional<Time>, Optional<Time>)
{
return EROFS;
}
@ -164,7 +164,7 @@ void ISO9660Inode::create_metadata()
{
u32 data_length = LittleEndian { m_record.data_length.little };
bool is_directory = has_flag(m_record.file_flags, ISO::FileFlags::Directory);
time_t recorded_at = parse_numerical_date_time(m_record.recording_date_and_time);
auto recorded_at = Time::from_timespec({ parse_numerical_date_time(m_record.recording_date_and_time), 0 });
m_metadata = {
.inode = identifier(),
@ -176,7 +176,7 @@ void ISO9660Inode::create_metadata()
.atime = recorded_at,
.ctime = recorded_at,
.mtime = recorded_at,
.dtime = 0,
.dtime = {},
.block_count = 0,
.block_size = 0,
.major_device = 0,