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

Kernel: Make kgettimeofday use AK::Time

This commit is contained in:
Ben Wiederhake 2021-02-28 02:18:48 +01:00 committed by Andreas Kling
parent 05d5e3fad9
commit 336303bda4
11 changed files with 28 additions and 26 deletions

View file

@ -114,10 +114,10 @@ NonnullRefPtr<TmpFSInode> TmpFSInode::create(TmpFS& fs, InodeMetadata metadata,
NonnullRefPtr<TmpFSInode> TmpFSInode::create_root(TmpFS& fs)
{
InodeMetadata metadata;
auto now = kgettimeofday();
metadata.atime = now.tv_sec;
metadata.ctime = now.tv_sec;
metadata.mtime = now.tv_sec;
auto now = kgettimeofday().to_truncated_seconds();
metadata.atime = now;
metadata.ctime = now;
metadata.mtime = now;
metadata.mode = S_IFDIR | S_ISVTX | 0777;
return create(fs, metadata, { fs.fsid(), 1 });
}
@ -280,15 +280,15 @@ KResultOr<NonnullRefPtr<Inode>> TmpFSInode::create_child(const String& name, mod
if (dev != 0)
return ENOTSUP;
struct timeval now = kgettimeofday();
time_t now = kgettimeofday().to_truncated_seconds();
InodeMetadata metadata;
metadata.mode = mode;
metadata.uid = uid;
metadata.gid = gid;
metadata.atime = now.tv_sec;
metadata.ctime = now.tv_sec;
metadata.mtime = now.tv_sec;
metadata.atime = now;
metadata.ctime = now;
metadata.mtime = now;
auto child = TmpFSInode::create(fs(), metadata, identifier());
auto result = add_child(child, name, mode);