fuse: use syscall errnos directly to fix deprecations

This commit is contained in:
Michael Eischer 2023-05-18 17:47:42 +02:00
parent e01baeabba
commit c832a492ac
2 changed files with 7 additions and 5 deletions

View file

@ -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
}
}

View file

@ -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