summaryrefslogtreecommitdiff
path: root/src/pkg/http/triv.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/http/triv.go')
-rw-r--r--src/pkg/http/triv.go5
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