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:53:27 +0100 |
commit | 91664defe0a75da15661a37a7f585b0c8523bf4e (patch) | |
tree | 8d7133037ce477c00ba0408d3f0892e0a8b5744d /src/pkg/http/triv.go | |
parent | ac2d3c9eb73a2d23848c55c3171d8ff6dd0feed9 (diff) | |
download | golang-91664defe0a75da15661a37a7f585b0c8523bf4e.tar.gz |
Imported Upstream version 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 |