From 4f6f07c07463c82eade76d84934f5432d283521d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 21 Mar 2018 11:13:17 +0000 Subject: [PATCH] cmount: fix error handling for Open/OpenDir --- cmd/cmount/fs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/cmount/fs.go b/cmd/cmount/fs.go index b993a222b..1b21ca7b5 100644 --- a/cmd/cmount/fs.go +++ b/cmd/cmount/fs.go @@ -204,7 +204,7 @@ func (fsys *FS) Getattr(path string, stat *fuse.Stat_t, fh uint64) (errc int) { func (fsys *FS) Opendir(path string) (errc int, fh uint64) { defer log.Trace(path, "")("errc=%d, fh=0x%X", &errc, &fh) handle, err := fsys.VFS.OpenFile(path, os.O_RDONLY, 0777) - if errc != 0 { + if err != nil { return translateError(err), fhUnset } return 0, fsys.openHandle(handle) @@ -285,7 +285,7 @@ func (fsys *FS) Open(path string, flags int) (errc int, fh uint64) { // translate the fuse flags to os flags flags = translateOpenFlags(flags) handle, err := fsys.VFS.OpenFile(path, flags, 0777) - if errc != 0 { + if err != nil { return translateError(err), fhUnset }