Skip to content

Commit

Permalink
Fixed the type of ErrNotExist wrapper (for compatibility with other c…
Browse files Browse the repository at this point in the history
…ode)
  • Loading branch information
0xef53 committed Nov 6, 2024
1 parent fe57e48 commit 05d1451
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kvmrun/backend/block/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (d *Device) IsAvailable() (bool, error) {
}

case os.IsNotExist(err):
return false, fmt.Errorf("%w: %s", os.ErrNotExist, d.Path)
return false, &os.PathError{Op: "stat", Path: d.Path, Err: os.ErrNotExist}
default:
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion kvmrun/backend/file/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (d *Device) IsAvailable() (bool, error) {
fi, err := os.Lstat(d.Path)
if err != nil {
if os.IsNotExist(err) {
return false, fmt.Errorf("%w: %s", os.ErrNotExist, d.Path)
return false, &os.PathError{Op: "stat", Path: d.Path, Err: os.ErrNotExist}
} else {
return false, err
}
Expand Down

0 comments on commit 05d1451

Please sign in to comment.