mirror of
https://github.com/rclone/rclone.git
synced 2024-12-20 02:06:15 +08:00
vfs: add ELOOP error
This commit is contained in:
parent
353bc3130e
commit
c0339327be
|
@ -602,6 +602,8 @@ func translateError(err error) (errc int) {
|
||||||
return -fuse.ENOSYS
|
return -fuse.ENOSYS
|
||||||
case vfs.EINVAL:
|
case vfs.EINVAL:
|
||||||
return -fuse.EINVAL
|
return -fuse.EINVAL
|
||||||
|
case vfs.ELOOP:
|
||||||
|
return -fuse.ELOOP
|
||||||
}
|
}
|
||||||
fs.Errorf(nil, "IO error: %v", err)
|
fs.Errorf(nil, "IO error: %v", err)
|
||||||
return -fuse.EIO
|
return -fuse.EIO
|
||||||
|
|
|
@ -100,6 +100,8 @@ func translateError(err error) error {
|
||||||
return syscall.ENOSYS
|
return syscall.ENOSYS
|
||||||
case vfs.EINVAL:
|
case vfs.EINVAL:
|
||||||
return fuse.Errno(syscall.EINVAL)
|
return fuse.Errno(syscall.EINVAL)
|
||||||
|
case vfs.ELOOP:
|
||||||
|
return fuse.Errno(syscall.ELOOP)
|
||||||
}
|
}
|
||||||
fs.Errorf(nil, "IO error: %v", err)
|
fs.Errorf(nil, "IO error: %v", err)
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -128,6 +128,8 @@ func translateError(err error) syscall.Errno {
|
||||||
return syscall.ENOSYS
|
return syscall.ENOSYS
|
||||||
case vfs.EINVAL:
|
case vfs.EINVAL:
|
||||||
return syscall.EINVAL
|
return syscall.EINVAL
|
||||||
|
case vfs.ELOOP:
|
||||||
|
return syscall.ELOOP
|
||||||
}
|
}
|
||||||
fs.Errorf(nil, "IO error: %v", err)
|
fs.Errorf(nil, "IO error: %v", err)
|
||||||
return syscall.EIO
|
return syscall.EIO
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
// Error describes low level errors in a cross platform way.
|
// Error describes low level errors in a cross platform way.
|
||||||
type Error byte
|
type Error byte
|
||||||
|
|
||||||
// NB if changing errors translateError in cmd/mount/fs.go, cmd/cmount/fs.go
|
// NB if changing errors, update translateError in cmd/mount/fs.go, cmd/cmount/fs.go, cmd/mount2/fs.go
|
||||||
|
|
||||||
// Low level errors
|
// Low level errors
|
||||||
const (
|
const (
|
||||||
|
@ -20,6 +20,7 @@ const (
|
||||||
EBADF
|
EBADF
|
||||||
EROFS
|
EROFS
|
||||||
ENOSYS
|
ENOSYS
|
||||||
|
ELOOP
|
||||||
)
|
)
|
||||||
|
|
||||||
// Errors which have exact counterparts in os
|
// Errors which have exact counterparts in os
|
||||||
|
@ -38,6 +39,7 @@ var errorNames = []string{
|
||||||
EBADF: "Bad file descriptor",
|
EBADF: "Bad file descriptor",
|
||||||
EROFS: "Read only file system",
|
EROFS: "Read only file system",
|
||||||
ENOSYS: "Function not implemented",
|
ENOSYS: "Function not implemented",
|
||||||
|
ELOOP: "Too many symbolic links",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error renders the error as a string
|
// Error renders the error as a string
|
||||||
|
|
Loading…
Reference in New Issue
Block a user