diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
commit | c072558b90f1bbedc2022b0f30c8b1ac4712538e (patch) | |
tree | 67767591619e4bd8111fb05fac185cde94fb7378 /src/pkg/http/triv.go | |
parent | 5859517b767c99749a45651c15d4bae5520ebae8 (diff) | |
download | golang-upstream/2011.02.15.tar.gz |
Imported Upstream version 2011.02.15upstream/2011.02.15
Diffstat (limited to 'src/pkg/http/triv.go')
-rw-r--r-- | src/pkg/http/triv.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/http/triv.go b/src/pkg/http/triv.go index 03cfafa7b..52d521d3d 100644 --- a/src/pkg/http/triv.go +++ b/src/pkg/http/triv.go @@ -99,15 +99,16 @@ func DateServer(rw http.ResponseWriter, req *http.Request) { fmt.Fprintf(rw, "pipe: %s\n", err) return } - pid, err := os.ForkExec("/bin/date", []string{"date"}, os.Environ(), "", []*os.File{nil, w, w}) + p, err := os.StartProcess("/bin/date", []string{"date"}, os.Environ(), "", []*os.File{nil, w, w}) defer r.Close() w.Close() if err != nil { fmt.Fprintf(rw, "fork/exec: %s\n", err) return } + defer p.Release() io.Copy(rw, r) - wait, err := os.Wait(pid, 0) + wait, err := p.Wait(0) if err != nil { fmt.Fprintf(rw, "wait: %s\n", err) return |