mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 10:58:55 +00:00
fuse: use syscall errnos directly to fix deprecations
This commit is contained in:
parent
e01baeabba
commit
c832a492ac
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/anacrolix/fuse"
|
||||
"github.com/anacrolix/fuse/fs"
|
||||
@ -202,7 +203,7 @@ func (d *dir) Lookup(ctx context.Context, name string) (fs.Node, error) {
|
||||
node, ok := d.items[name]
|
||||
if !ok {
|
||||
debug.Log(" Lookup(%v) -> not found", name)
|
||||
return nil, fuse.ENOENT
|
||||
return nil, syscall.ENOENT
|
||||
}
|
||||
inode := inodeFromNode(d.inode, node)
|
||||
switch node.Type {
|
||||
@ -216,7 +217,7 @@ func (d *dir) Lookup(ctx context.Context, name string) (fs.Node, error) {
|
||||
return newOther(d.root, inode, node)
|
||||
default:
|
||||
debug.Log(" node %v has unknown type %v", name, node.Type)
|
||||
return nil, fuse.ENOENT
|
||||
return nil, syscall.ENOENT
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ package fuse
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"github.com/restic/restic/internal/debug"
|
||||
"github.com/restic/restic/internal/restic"
|
||||
@ -60,7 +61,7 @@ func (d *SnapshotsDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
|
||||
if err != nil {
|
||||
return nil, unwrapCtxCanceled(err)
|
||||
} else if meta == nil {
|
||||
return nil, fuse.ENOENT
|
||||
return nil, syscall.ENOENT
|
||||
}
|
||||
|
||||
items := []fuse.Dirent{
|
||||
@ -99,7 +100,7 @@ func (d *SnapshotsDir) Lookup(ctx context.Context, name string) (fs.Node, error)
|
||||
if err != nil {
|
||||
return nil, unwrapCtxCanceled(err)
|
||||
} else if meta == nil {
|
||||
return nil, fuse.ENOENT
|
||||
return nil, syscall.ENOENT
|
||||
}
|
||||
|
||||
entry := meta.names[name]
|
||||
@ -114,7 +115,7 @@ func (d *SnapshotsDir) Lookup(ctx context.Context, name string) (fs.Node, error)
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fuse.ENOENT
|
||||
return nil, syscall.ENOENT
|
||||
}
|
||||
|
||||
// SnapshotLink
|
||||
|
Loading…
Reference in New Issue
Block a user