aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-10-20 10:40:42 +0200
committerDmitry Vyukov <dvyukov@google.com>2015-10-20 15:46:04 +0200
commita8c682fe99f6f4efbfd6f640870d956c814e26bf (patch)
tree79b90bf954e3b6cdd84cc947bf4b85f799d3bf96 /ipc
parent505473bd9be2eefb9e1ab0291da91ae2e40f9ed1 (diff)
dump executor output directly to console when debug
Otherwise there is no way to see the output if executor hangs dead.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/ipc/ipc.go b/ipc/ipc.go
index bf5f38207..511398a7f 100644
--- a/ipc/ipc.go
+++ b/ipc/ipc.go
@@ -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}