diff options
Diffstat (limited to 'libgo/go/syscall/syscall_test.go')
-rw-r--r-- | libgo/go/syscall/syscall_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libgo/go/syscall/syscall_test.go b/libgo/go/syscall/syscall_test.go index 846c487..0a0b8b7 100644 --- a/libgo/go/syscall/syscall_test.go +++ b/libgo/go/syscall/syscall_test.go @@ -6,6 +6,8 @@ package syscall_test import ( "fmt" + "internal/testenv" + "os" "syscall" "testing" ) @@ -45,3 +47,15 @@ func TestItoa(t *testing.T) { t.Fatalf("itoa(%d) = %s, want %s", i, s, f) } } + +// Check that permuting child process fds doesn't interfere with +// reporting of fork/exec status. See Issue 14979. +func TestExecErrPermutedFds(t *testing.T) { + testenv.MustHaveExec(t) + + attr := &os.ProcAttr{Files: []*os.File{os.Stdin, os.Stderr, os.Stdout}} + _, err := os.StartProcess("/", []string{"/"}, attr) + if err == nil { + t.Fatalf("StartProcess of invalid program returned err = nil") + } +} |