Skip to content

Commit

Permalink
libct: createExecFifo: optimize
Browse files Browse the repository at this point in the history
Every time we call container.Config(), a new copy of
struct Config is created and returned, and we do it twice here.

Accessing container.config directly fixes this.

Fixes: 805b8c7 ("Do not create exec fifo in factory.Create")
Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Jan 16, 2025
1 parent 044f459 commit b6a750f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,11 @@ func (c *Container) signal(s os.Signal) error {
}

func (c *Container) createExecFifo() (retErr error) {
rootuid, err := c.Config().HostRootUID()
rootuid, err := c.config.HostRootUID()
if err != nil {
return err
}
rootgid, err := c.Config().HostRootGID()
rootgid, err := c.config.HostRootGID()
if err != nil {
return err
}
Expand Down

0 comments on commit b6a750f

Please sign in to comment.