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
commit bd185813ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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