Pārlūkot izejas kodu

Kernel: Use correct timestamp in sys$utimens()

We were mixing up the nanosecond and second parts of the timestamps.

Regressed in 280694bb46202c4a4a704f227d6141dc483bbeb4.
Andreas Kling 2 gadi atpakaļ
vecāks
revīzija
2cc947ede4
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      Kernel/FileSystem/VirtualFileSystem.cpp

+ 2 - 2
Kernel/FileSystem/VirtualFileSystem.cpp

@@ -228,9 +228,9 @@ ErrorOr<void> VirtualFileSystem::utimensat(Credentials const& credentials, Strin
 
 
     // NOTE: A standard ext2 inode cannot store nanosecond timestamps.
     // NOTE: A standard ext2 inode cannot store nanosecond timestamps.
     TRY(inode.update_timestamps(
     TRY(inode.update_timestamps(
-        (atime.tv_nsec != UTIME_OMIT) ? atime.tv_nsec : Optional<time_t> {},
+        (atime.tv_nsec != UTIME_OMIT) ? atime.tv_sec : Optional<time_t> {},
         {},
         {},
-        (mtime.tv_nsec != UTIME_OMIT) ? mtime.tv_nsec : Optional<time_t> {}));
+        (mtime.tv_nsec != UTIME_OMIT) ? mtime.tv_sec : Optional<time_t> {}));
 
 
     return {};
     return {};
 }
 }