Home | History | Annotate | Download | only in osutil

Lines Matching refs:Cmd

24 	cmd := Command(bin, args...)
25 cmd.Dir = dir
26 return Run(timeout, cmd)
29 // Run runs cmd with the specified timeout.
31 func Run(timeout time.Duration, cmd *exec.Cmd) ([]byte, error) {
33 if cmd.Stdout == nil {
34 cmd.Stdout = output
36 if cmd.Stderr == nil {
37 cmd.Stderr = output
39 if err := cmd.Start(); err != nil {
40 return nil, fmt.Errorf("failed to start %v %+v: %v", cmd.Path, cmd.Args, err)
49 cmd.Process.Kill()
55 err := cmd.Wait()
58 text := fmt.Sprintf("failed to run %q: %v", cmd.Args, err)
60 text = fmt.Sprintf("timedout %q", cmd.Args)
71 func Command(bin string, args ...string) *exec.Cmd {
72 cmd := exec.Command(bin, args...)
73 setPdeathsig(cmd)
74 return cmd