Commit 5aad5146 authored by Alex Brainman's avatar Alex Brainman

syscall: correct Windows CreateProcess input parameters

Fixes #1718.

R=golang-dev, rsc, peterGo, r
CC=golang-dev
https://golang.org/cl/4435059
parent 98cf39e2
......@@ -285,7 +285,7 @@ func doRun(argv []string, returnStdout bool) string {
}
cmd += `"` + v + `"`
}
argv = []string{"cmd", "/c", "sh", "-c", cmd}
argv = []string{"sh", "-c", cmd}
}
var err os.Error
argv[0], err = exec.LookPath(argv[0])
......
......@@ -9,19 +9,14 @@ import (
"io/ioutil"
"testing"
"os"
"runtime"
)
func run(argv []string, stdin, stdout, stderr int) (p *Cmd, err os.Error) {
if runtime.GOOS == "windows" {
argv = append([]string{"cmd", "/c"}, argv...)
}
exe, err := LookPath(argv[0])
if err != nil {
return nil, err
}
p, err = Run(exe, argv, nil, "", stdin, stdout, stderr)
return p, err
return Run(exe, argv, nil, "", stdin, stdout, stderr)
}
func TestRunCat(t *testing.T) {
......
......@@ -8,6 +8,7 @@ package syscall
import (
"sync"
"unsafe"
"utf16"
)
......@@ -279,7 +280,7 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int,
}
}
si := new(StartupInfo)
GetStartupInfo(si)
si.Cb = uint32(unsafe.Sizeof(*si))
si.Flags = STARTF_USESTDHANDLES
si.StdInput = fd[0]
si.StdOutput = fd[1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment