OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // godoc: Go Documentation Server | 5 // godoc: Go Documentation Server |
6 | 6 |
7 // Web server tree: | 7 // Web server tree: |
8 // | 8 // |
9 // http://godoc/ main landing page | 9 // http://godoc/ main landing page |
10 // http://godoc/doc/ serve from $GOROOT/doc - spec, mem, tutorial, et
c. | 10 // http://godoc/doc/ serve from $GOROOT/doc - spec, mem, tutorial, et
c. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if err != nil { | 76 if err != nil { |
77 log.Printf("os.Pipe(): %v", err) | 77 log.Printf("os.Pipe(): %v", err) |
78 return 2 | 78 return 2 |
79 } | 79 } |
80 | 80 |
81 bin := args[0] | 81 bin := args[0] |
82 fds := []*os.File{nil, w, w} | 82 fds := []*os.File{nil, w, w} |
83 if *verbose { | 83 if *verbose { |
84 log.Printf("executing %v", args) | 84 log.Printf("executing %v", args) |
85 } | 85 } |
86 » p, err := os.StartProcess(bin, args, os.Environ(), *goroot, fds) | 86 » var attrs os.ProcAttributes |
| 87 » attrs.Chdir(*goroot) |
| 88 » p, err := os.StartProcess(bin, args, os.Environ(), fds, &attrs) |
87 defer r.Close() | 89 defer r.Close() |
88 w.Close() | 90 w.Close() |
89 if err != nil { | 91 if err != nil { |
90 log.Printf("os.StartProcess(%q): %v", bin, err) | 92 log.Printf("os.StartProcess(%q): %v", bin, err) |
91 return 2 | 93 return 2 |
92 } | 94 } |
93 defer p.Release() | 95 defer p.Release() |
94 | 96 |
95 var buf bytes.Buffer | 97 var buf bytes.Buffer |
96 io.Copy(&buf, r) | 98 io.Copy(&buf, r) |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 385 |
384 case info.PDoc != nil: | 386 case info.PDoc != nil: |
385 info.PDoc.Filter(filter) | 387 info.PDoc.Filter(filter) |
386 } | 388 } |
387 } | 389 } |
388 | 390 |
389 if err := packageText.Execute(os.Stdout, info); err != nil { | 391 if err := packageText.Execute(os.Stdout, info); err != nil { |
390 log.Printf("packageText.Execute: %s", err) | 392 log.Printf("packageText.Execute: %s", err) |
391 } | 393 } |
392 } | 394 } |
OLD | NEW |