Skip to content

Commit

Permalink
Merge pull request #3286 from chendave/cleanup
Browse files Browse the repository at this point in the history
Avoid non-op when the list of `Hooks` is empty
  • Loading branch information
thaJeztah authored Nov 19, 2021
2 parents eba6097 + 1362291 commit d1f316f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libcontainer/process_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func (p *initProcess) start() (retErr error) {
}
}

if p.config.Config.Hooks != nil {
if len(p.config.Config.Hooks) != 0 {
s, err := p.container.currentOCIState()
if err != nil {
return err
Expand Down Expand Up @@ -571,7 +571,7 @@ func (p *initProcess) start() (retErr error) {
return fmt.Errorf("error setting Intel RDT config for procHooks process: %w", err)
}
}
if p.config.Config.Hooks != nil {
if len(p.config.Config.Hooks) != 0 {
s, err := p.container.currentOCIState()
if err != nil {
return err
Expand Down

0 comments on commit d1f316f

Please sign in to comment.