Merge pull request #8504 from dcantah/close-f-early

Simplify closing bundle dir fd
This commit is contained in:
Fu Wei
2023-05-10 10:09:01 +08:00
committed by GitHub

View File

@@ -91,13 +91,12 @@ func (m *ShimManager) loadShims(ctx context.Context) error {
}
bf, err := f.Readdirnames(-1)
if err != nil {
f.Close()
if err != nil {
bundle.Delete()
log.G(ctx).WithError(err).Errorf("fast path read bundle path for %s", bundle.Path)
continue
}
f.Close()
if len(bf) == 0 {
bundle.Delete()
continue