From e6c44bdbdd176c242da8bffade713f4a67418642 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Mon, 22 Feb 2016 23:00:33 +0100 Subject: [PATCH] Terminate the stub before -exec. --- eval/builtin_func.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eval/builtin_func.go b/eval/builtin_func.go index 69a67a39..14096e5a 100644 --- a/eval/builtin_func.go +++ b/eval/builtin_func.go @@ -673,6 +673,9 @@ func _exec(ec *EvalCtx, args ...string) { if err != nil { fmt.Fprintln(os.Stderr, err) } + if ec.Stub != nil { + ec.Stub.Terminate() + } err = syscall.Exec(args[0], args, os.Environ()) maybeThrow(err) }