From c832a492ac6c95e22e745499b3a0f4f02ef7062d Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 18 May 2023 17:47:42 +0200 Subject: [PATCH] fuse: use syscall errnos directly to fix deprecations --- internal/fuse/dir.go | 5 +++-- internal/fuse/snapshots_dir.go | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/fuse/dir.go b/internal/fuse/dir.go index 3984f15af..3d12d263b 100644 --- a/internal/fuse/dir.go +++ b/internal/fuse/dir.go @@ -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 } } diff --git a/internal/fuse/snapshots_dir.go b/internal/fuse/snapshots_dir.go index c19155741..6d18a084b 100644 --- a/internal/fuse/snapshots_dir.go +++ b/internal/fuse/snapshots_dir.go @@ -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