Fix daemon build on Windows.

This commit is contained in:
Qi Xiao 2017-12-15 22:12:59 +01:00
parent 5465aceb3e
commit 0ded0b92ec

View File

@ -19,7 +19,7 @@ const (
DaemonCreationFlags = CREATE_BREAKAWAY_FROM_JOB | CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS DaemonCreationFlags = CREATE_BREAKAWAY_FROM_JOB | CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS
) )
func procAttrForFirstFork() *os.ProcAttr { func procAttrForSpawn() *os.ProcAttr {
return &os.ProcAttr{ return &os.ProcAttr{
Dir: `C:\`, Dir: `C:\`,
Env: []string{"SystemRoot=" + os.Getenv("SystemRoot")}, // SystemRoot is needed for net.Listen for some reason Env: []string{"SystemRoot=" + os.Getenv("SystemRoot")}, // SystemRoot is needed for net.Listen for some reason