dump executor output directly to console when debug

Otherwise there is no way to see the output if executor hangs dead.
This commit is contained in:
Dmitry Vyukov 2015-10-20 10:40:42 +02:00
parent 505473bd9b
commit a8c682fe99

View File

@ -194,8 +194,13 @@ func (env *Env) execBin() (output, strace []byte, failed, hanged bool, err0 erro
cmd.ExtraFiles = append(cmd.ExtraFiles, env.inFile, env.outFile)
cmd.Env = []string{}
cmd.Dir = dir
cmd.Stdout = wp
cmd.Stderr = wp
if env.flags&FlagDebug == 0 {
cmd.Stdout = wp
cmd.Stderr = wp
} else {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stdout
}
if syscall.Getuid() == 0 {
// Running under root, more isolation is possible.
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true, Cloneflags: syscall.CLONE_NEWNS}