]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.4] undo CL 131750044 / 2d6d44ceb80e
authorRuss Cox <rsc@golang.org>
Wed, 19 Nov 2014 19:38:22 +0000 (14:38 -0500)
committerIan Lance Taylor <iant@golang.org>
Wed, 19 Nov 2014 19:38:22 +0000 (14:38 -0500)
commitb4df0154c21cd5d229138c678007aafca0867432
tree2e12b1f2c97377900e5d9506eef91fe5f34208f5
parentc9e183e7814e4399591025c03a00214219930fc0
[release-branch.go1.4] undo CL 131750044 / 2d6d44ceb80e

««« CL 174450043 / 699cc091a16d
undo CL 131750044 / 2d6d44ceb80e

Breaks reading from stdin in parent after exec with SysProcAttr{Setpgid: true}.

package main

import (
        "fmt"
        "os"
        "os/exec"
        "syscall"
)

func main() {
        cmd := exec.Command("true")
        cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
        cmd.Run()

        fmt.Printf("Hit enter:")
        os.Stdin.Read(make([]byte, 100))
        fmt.Printf("Bye\n")
}

In go1.3, I type enter at the prompt and the program exits.
With the CL being rolled back, the program wedges at the
prompt.

««« original CL description
syscall: SysProcAttr job control changes

Making the child's process group the foreground process group and
placing the child in a specific process group involves co-ordination
between the parent and child that must be done post-fork but pre-exec.

LGTM=iant
R=golang-codereviews, gobot, iant, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/131750044

»»»

LGTM=minux, dneil
R=dneil, minux
CC=golang-codereviews, iant, michael.p.macinnis
https://golang.org/cl/174450043
»»»

LGTM=minux
R=dneil, minux
CC=golang-codereviews
https://golang.org/cl/179970043
src/syscall/exec_bsd.go
src/syscall/exec_linux.go