summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/file.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-06-14 22:45:33 +0200
committerJakob Unterwurzacher2016-06-14 22:46:23 +0200
commit393e531afd64ad6c5d1db4c36312a29233c8d3f2 (patch)
treeab6f8c0dca1570dff4e7af01f77f7ccc9fbb227b /internal/fusefrontend/file.go
parent620dba30c4a5886519767b9507c6e0361d7339e5 (diff)
Fix warnings reported by Go 1.6 "go tool vet -shadow=true"
Warnings were: main.go:234: declaration of err shadows declaration at main.go:163: internal/fusefrontend/file.go:401: declaration of err shadows declaration at internal/fusefrontend/file.go:379: internal/fusefrontend/file.go:419: declaration of err shadows declaration at internal/fusefrontend/file.go:379: internal/fusefrontend/fs_dir.go:140: declaration of err shadows declaration at internal/fusefrontend/fs_dir.go:97:
Diffstat (limited to 'internal/fusefrontend/file.go')
-rw-r--r--internal/fusefrontend/file.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index 62303df..96a07fc 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -361,10 +361,11 @@ func (f *file) Truncate(newSize uint64) fuse.Status {
}
wlock.lock(f.ino)
defer wlock.unlock(f.ino)
+ var err error
// Common case first: Truncate to zero
if newSize == 0 {
- err := syscall.Ftruncate(int(f.fd.Fd()), 0)
+ err = syscall.Ftruncate(int(f.fd.Fd()), 0)
if err != nil {
toggledlog.Warn.Printf("ino%d fh%d: Ftruncate(fd, 0) returned error: %v", f.ino, f.intFd(), err)
return fuse.ToStatus(err)
@@ -398,7 +399,7 @@ func (f *file) Truncate(newSize uint64) fuse.Status {
// File was empty, create new header
if oldSize == 0 {
- err := f.createHeader()
+ err = f.createHeader()
if err != nil {
return fuse.ToStatus(err)
}
@@ -416,7 +417,7 @@ func (f *file) Truncate(newSize uint64) fuse.Status {
}
} else {
off, length := b.CiphertextRange()
- err := syscall.Ftruncate(int(f.fd.Fd()), int64(off+length))
+ err = syscall.Ftruncate(int(f.fd.Fd()), int64(off+length))
if err != nil {
toggledlog.Warn.Printf("grow Ftruncate returned error: %v", err)
return fuse.ToStatus(err)