aboutsummaryrefslogtreecommitdiff
path: root/libtrivfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-02 02:21:18 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-02 02:21:18 +0100
commitcb8ac8c47b03833fa7eebcb2ce94801f13da2bd7 (patch)
treefbc9b9aad76b657ed7ee90593f4cf86bafd84284 /libtrivfs
parent293058a2a316e9acaf637f4a7430a13e8c04d672 (diff)
downloadhurd-cb8ac8c47b03833fa7eebcb2ce94801f13da2bd7.tar.gz
hurd-cb8ac8c47b03833fa7eebcb2ce94801f13da2bd7.tar.bz2
hurd-cb8ac8c47b03833fa7eebcb2ce94801f13da2bd7.zip
libtrivfs: Avoid passing uninitialized seconds field
Even if microseconds being -1 is enough, better not leak uninitialized values.
Diffstat (limited to 'libtrivfs')
-rw-r--r--libtrivfs/file-utimes.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libtrivfs/file-utimes.c b/libtrivfs/file-utimes.c
index 7c5eaf43..d71c169f 100644
--- a/libtrivfs/file-utimes.c
+++ b/libtrivfs/file-utimes.c
@@ -45,12 +45,18 @@ trivfs_S_file_utimens (struct trivfs_protid *cred,
time_value_t atim, mtim;
if (atime.tv_nsec == UTIME_NOW)
- atim.microseconds = -1;
+ {
+ atim.seconds = -1;
+ atim.microseconds = -1;
+ }
else
TIMESPEC_TO_TIME_VALUE (&atim, &atime);
if (mtime.tv_nsec == UTIME_NOW)
- mtim.microseconds = -1;
+ {
+ mtim.seconds = -1;
+ mtim.microseconds = -1;
+ }
else
TIMESPEC_TO_TIME_VALUE (&mtim, &mtime);