mirror of
https://github.com/containers/podman.git
synced 2026-02-05 06:45:31 +01:00
fix(emulation): handle fs.ErrNotExist in registeredBinfmtMisc
When `/proc/sys/fs/binfmt_misc` is not mounted, filepath.WalkDir may return fs.ErrNotExist errors. These should be handled gracefully and return nil instead of causing a panic. Signed-off-by: Peiyuan Song <squallatf@gmail.com>
This commit is contained in:
@@ -27,7 +27,10 @@ func registeredBinfmtMisc() ([]string, error) {
|
||||
if filepath.Base(path) == "register" { // skip this one
|
||||
return nil
|
||||
}
|
||||
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
info, err := d.Info()
|
||||
|
||||
Reference in New Issue
Block a user