diff options
author | Jakob Unterwurzacher | 2016-08-09 22:18:46 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-08-09 22:18:46 +0200 |
commit | af5441dcd9033e81da43ab77887a7b5aac693ab6 (patch) | |
tree | 54d8efea78ebc56d8f8f62ffc20f527d5adc4a05 /internal/fusefrontend/fs.go | |
parent | fc0de96763280d24cfb30646c82efddb18cbb59d (diff) |
fusefrontend: use NsecToTimespec() for Utimens
This fixes a build problem on 32-bit hosts:
internal/fusefrontend/file.go:400: cannot use a.Unix() (type int64) as
type int32 in assignment
internal/fusefrontend/file.go:406: cannot use m.Unix() (type int64) as
type int32 in assignment
It also enables full nanosecond timestamps for dates
after 1970.
Diffstat (limited to 'internal/fusefrontend/fs.go')
-rw-r--r-- | internal/fusefrontend/fs.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index 5367622..1219479 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -230,15 +230,18 @@ func (fs *FS) Truncate(path string, offset uint64, context *fuse.Context) (code return code } -func (fs *FS) Utimens(path string, Atime *time.Time, Mtime *time.Time, context *fuse.Context) (code fuse.Status) { +func (fs *FS) Utimens(path string, a *time.Time, m *time.Time, context *fuse.Context) (code fuse.Status) { if fs.isFiltered(path) { return fuse.EPERM } - cPath, err := fs.encryptPath(path) + cPath, err := fs.getBackingPath(path) if err != nil { return fuse.ToStatus(err) } - return fs.FileSystem.Utimens(cPath, Atime, Mtime, context) + ts := make([]syscall.Timespec, 2) + ts[0] = utimeToTimespec(a) + ts[1] = utimeToTimespec(m) + return fuse.ToStatus(syscall.UtimesNano(cPath, ts)) } func (fs *FS) StatFs(path string) *fuse.StatfsOut { |