From: Ian Lance Taylor Date: Fri, 20 Jan 2017 06:07:20 +0000 (-0800) Subject: misc/cgo/test: pass current environment to syscall.Exec X-Git-Tag: go1.8rc3~1^2~14 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1be957d703832aa10952c4dc799dcc3a39f48aff;p=gostls13.git misc/cgo/test: pass current environment to syscall.Exec This is needed for typical tests with gccgo, as it passes the LD_LIBRARY_PATH environment variable to the new program. Change-Id: I9bf4b0dbdff63f5449c7fcb8124eaeab10ed7f34 Reviewed-on: https://go-review.googlesource.com/35481 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/misc/cgo/test/issue18146.go b/misc/cgo/test/issue18146.go index ffb04e9037..3c600463f0 100644 --- a/misc/cgo/test/issue18146.go +++ b/misc/cgo/test/issue18146.go @@ -73,7 +73,7 @@ func test18146(t *testing.T) { } runtime.GOMAXPROCS(threads) argv := append(os.Args, "-test.run=NoSuchTestExists") - if err := syscall.Exec(os.Args[0], argv, nil); err != nil { + if err := syscall.Exec(os.Args[0], argv, os.Environ()); err != nil { t.Fatal(err) } }