瀏覽代碼

TmpFS: Set the root inode's timestamp to the current time

cc @bcoles :^)
Andreas Kling 4 年之前
父節點
當前提交
abe9cec612
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Kernel/FileSystem/TmpFS.cpp

+ 4 - 0
Kernel/FileSystem/TmpFS.cpp

@@ -114,6 +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;
     metadata.mode = S_IFDIR | S_ISVTX | 0777;
     return create(fs, metadata, { fs.fsid(), 1 });
 }