aboutsummaryrefslogtreecommitdiff
path: root/libtrivfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 11:57:42 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 11:57:42 +0100
commit6e14088111d1cbbbca30ebe0e73135b6c3de398d (patch)
tree2f3dac0e14f7778136cdc774108b2185a673bd30 /libtrivfs
parentc851c4a857aec23e21ca8769b92e862e6471c852 (diff)
downloadhurd-6e14088111d1cbbbca30ebe0e73135b6c3de398d.tar.gz
hurd-6e14088111d1cbbbca30ebe0e73135b6c3de398d.tar.bz2
hurd-6e14088111d1cbbbca30ebe0e73135b6c3de398d.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/times.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libtrivfs/times.c b/libtrivfs/times.c
index 5e20bf10..6cdf3f62 100644
--- a/libtrivfs/times.c
+++ b/libtrivfs/times.c
@@ -41,6 +41,7 @@ trivfs_set_atime (struct trivfs_control *cntl)
io_stat (cntl->underlying, &st);
TIMESPEC_TO_TIME_VALUE (&atim, &st.st_atim);
+ mtim.seconds = -1;
mtim.microseconds = -1;
err = file_utimes (cntl->underlying, atim, mtim);
}
@@ -71,6 +72,7 @@ trivfs_set_mtime (struct trivfs_control *cntl)
io_stat (cntl->underlying, &st);
+ atim.seconds = -1;
atim.microseconds = -1;
TIMESPEC_TO_TIME_VALUE (&mtim, &st.st_mtim);
err = file_utimes (cntl->underlying, atim, mtim);