Preserve log FD after execve

PiperOrigin-RevId: 306908296
This commit is contained in:
Fabricio Voznika
2020-04-16 13:17:00 -07:00
committed by gVisor bot
parent eb7b1903e0
commit 5a8ee1beee
+1 -1
View File
@@ -291,7 +291,7 @@ func main() {
// want with them. Since Docker and Containerd both eat boot's stderr, we
// dup our stderr to the provided log FD so that panics will appear in the
// logs, rather than just disappear.
if err := syscall.Dup3(fd, int(os.Stderr.Fd()), syscall.O_CLOEXEC); err != nil {
if err := syscall.Dup3(fd, int(os.Stderr.Fd()), 0); err != nil {
cmd.Fatalf("error dup'ing fd %d to stderr: %v", fd, err)
}
}