mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 10:13:52 +08:00
cmount: fix error handling for Open/OpenDir
This commit is contained in:
parent
f6020f1308
commit
4f6f07c074
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user