summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-13 16:56:19 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-13 17:03:31 +0200
commit2cc947ede46824e8c57821769b7276856a459e83 (patch)
treef57ebd830d6dbd764efda3a258697e7360fb2d10 /Kernel/FileSystem/VirtualFileSystem.cpp
parent54e0e8558125ba60393b10925c2652050732c9f2 (diff)
downloadserenity-2cc947ede46824e8c57821769b7276856a459e83.zip
Kernel: Use correct timestamp in sys$utimens()
We were mixing up the nanosecond and second parts of the timestamps. Regressed in 280694bb46202c4a4a704f227d6141dc483bbeb4.
Diffstat (limited to 'Kernel/FileSystem/VirtualFileSystem.cpp')
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp
index 2a1c183a43..b10645d74c 100644
--- a/Kernel/FileSystem/VirtualFileSystem.cpp
+++ b/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.
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 {};
}