~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to src/pkg/os/exec/exec.go

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        "syscall"
17
17
)
18
18
 
19
 
// Error records the name of a binary that failed to be be executed
 
19
// Error records the name of a binary that failed to be executed
20
20
// and the reason it failed.
21
21
type Error struct {
22
22
        Name string
37
37
 
38
38
        // Args holds command line arguments, including the command as Args[0].
39
39
        // If the Args field is empty or nil, Run uses {Path}.
40
 
        // 
 
40
        //
41
41
        // In typical use, both Path and Args are set by calling Command.
42
42
        Args []string
43
43
 
143
143
func (c *Cmd) stdin() (f *os.File, err error) {
144
144
        if c.Stdin == nil {
145
145
                f, err = os.Open(os.DevNull)
 
146
                if err != nil {
 
147
                        return
 
148
                }
146
149
                c.closeAfterStart = append(c.closeAfterStart, f)
147
150
                return
148
151
        }
182
185
func (c *Cmd) writerDescriptor(w io.Writer) (f *os.File, err error) {
183
186
        if w == nil {
184
187
                f, err = os.OpenFile(os.DevNull, os.O_WRONLY, 0)
 
188
                if err != nil {
 
189
                        return
 
190
                }
185
191
                c.closeAfterStart = append(c.closeAfterStart, f)
186
192
                return
187
193
        }
229
235
// Start starts the specified command but does not wait for it to complete.
230
236
func (c *Cmd) Start() error {
231
237
        if c.err != nil {
 
238
                c.closeDescriptors(c.closeAfterStart)
 
239
                c.closeDescriptors(c.closeAfterWait)
232
240
                return c.err
233
241
        }
234
242
        if c.Process != nil {