summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-04-23 00:06:56 +0200
committerJakob Unterwurzacher2017-04-23 00:06:56 +0200
commit9777e4bf7ea2aa75ab443dc6e15c42103eb6b027 (patch)
tree1004268a2dddca585da480fe3b5825599f79be3d
parent8ed89a13acc5e9fdf80de975fbb67f485fff8986 (diff)
Fix Flock build breakage
go-fuse has added a new method to the nodefs.File interface that caused this build error: internal/fusefrontend/file.go:75: cannot use file literal (type *file) as type nodefs.File in return argument: *file does not implement nodefs.File (missing Flock method) Fixes https://github.com/rfjakob/gocryptfs/issues/104 and prevents the problem from happening again.
-rw-r--r--internal/fusefrontend/file.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index 6096501..84ce058 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -52,6 +52,10 @@ type file struct {
lastOpCount uint64
// Parent filesystem
fs *FS
+ // We embed a nodefs.NewDefaultFile() that returns ENOSYS for every operation we
+ // have not implemented. This prevents build breakage when the go-fuse library
+ // adds new methods to the nodefs.File interface.
+ nodefs.File
}
// NewFile returns a new go-fuse File instance.
@@ -73,6 +77,7 @@ func NewFile(fd *os.File, writeOnly bool, fs *FS) (nodefs.File, fuse.Status) {
fileTableEntry: t,
loopbackFile: nodefs.NewLoopbackFile(fd),
fs: fs,
+ File: nodefs.NewDefaultFile(),
}, fuse.OK
}