Skip to content

Commit

Permalink
Remove pipe close before exec.
Browse files Browse the repository at this point in the history
Pipe close before exec is not necessary as os.Pipe() is calling pipe2
with O_CLOEXEC option.

Signed-off-by: Marco Vedovati <[email protected]>
Co-authored-by: Georgi Sabev <[email protected]>
  • Loading branch information
2 people authored and danail-branekov committed Apr 4, 2019
1 parent 8e8a907 commit e4ca720
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions libcontainer/standard_init_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/opencontainers/runc/libcontainer/system"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"golang.org/x/sys/unix"
)
Expand Down Expand Up @@ -208,10 +207,6 @@ func (l *linuxStandardInit) Init() error {
return newSystemErrorWithCause(err, "init seccomp")
}
}

logPipe, _ := (logrus.StandardLogger().Out).(*(os.File))
logPipe.Close()

if err := syscall.Exec(name, l.config.Args[0:], os.Environ()); err != nil {
return newSystemErrorWithCause(err, "exec user process")
}
Expand Down

0 comments on commit e4ca720

Please sign in to comment.