shithub: mntgen

Download patch

ref: e74ed1deb8aeb00b24335348e7cd75d0d87201cc
parent: 78d3841fe254d3a843b08590cdce1d96da31cc47
author: Alex Musolino <alex@musolino.id.au>
date: Tue Jan 3 15:54:42 EST 2023

only sample time once in NewDir

--- a/mntgen.go
+++ b/mntgen.go
@@ -23,14 +23,15 @@
 
 func NewDir(fs *FS, name string) *Dir {
 	atomic.AddUint64(&inodeCount, 1)
+	now := time.Now()
 	return &Dir{
 		Fs:   fs,
 		Name: name,
 		Attributes: fuse.Attr{
 			Inode: inodeCount,
-			Atime: time.Now(),
-			Mtime: time.Now(),
-			Ctime: time.Now(),
+			Atime: now,
+			Mtime: now,
+			Ctime: now,
 			Mode:  os.ModeDir | 0o755,
 			Nlink: 2,
 			Uid:   uint32(os.Getuid()),