Merge pull request #8504 from dcantah/close-f-early
Simplify closing bundle dir fd
This commit is contained in:
commit
bd185813ac
@ -91,13 +91,12 @@ func (m *ShimManager) loadShims(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bf, err := f.Readdirnames(-1)
|
bf, err := f.Readdirnames(-1)
|
||||||
|
f.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
f.Close()
|
|
||||||
bundle.Delete()
|
bundle.Delete()
|
||||||
log.G(ctx).WithError(err).Errorf("fast path read bundle path for %s", bundle.Path)
|
log.G(ctx).WithError(err).Errorf("fast path read bundle path for %s", bundle.Path)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
f.Close()
|
|
||||||
if len(bf) == 0 {
|
if len(bf) == 0 {
|
||||||
bundle.Delete()
|
bundle.Delete()
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user