From feebfac358ca83fe0a1132f1b2a6da5fca69f1ce Mon Sep 17 00:00:00 2001 From: Marco Vedovati Date: Fri, 10 Aug 2018 11:23:30 +0200 Subject: [PATCH] Remove pipe close before exec. Pipe close before exec is not necessary as os.Pipe() is calling pipe2 with O_CLOEXEC option. Signed-off-by: Marco Vedovati --- libcontainer/standard_init_linux.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libcontainer/standard_init_linux.go b/libcontainer/standard_init_linux.go index ce65b17b..4e03b8bc 100644 --- a/libcontainer/standard_init_linux.go +++ b/libcontainer/standard_init_linux.go @@ -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" ) @@ -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") }