mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 16:35:44 +03:00
compile on windows
This commit is contained in:
committed by
Michael Schurter
parent
7b7cb382dc
commit
3c0b073513
@@ -9,10 +9,10 @@ import (
|
||||
// configure new process group for child process
|
||||
func (e *UniversalExecutor) setNewProcessGroup() error {
|
||||
// We need to check that as build flags includes windows for this file
|
||||
if e.cmd.SysProcAttr == nil {
|
||||
e.cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||
if e.childCmd.SysProcAttr == nil {
|
||||
e.childCmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||
}
|
||||
e.cmd.SysProcAttr.CreationFlags = syscall.CREATE_NEW_PROCESS_GROUP
|
||||
e.childCmd.SysProcAttr.CreationFlags = syscall.CREATE_NEW_PROCESS_GROUP
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ func (f *NetworkFingerprint) linkSpeed(device string) int {
|
||||
outBytes, err := exec.Command(path, command).Output()
|
||||
|
||||
if err != nil {
|
||||
f.logger.Printf("[WARN] fingerprint.network: Error calling %s (%s): %v", path, command, err)
|
||||
f.logger.Warn("failed to detect link speed", "path", path, "command", command, "error", err)
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ func (f *NetworkFingerprint) linkSpeed(device string) int {
|
||||
func (f *NetworkFingerprint) parseLinkSpeed(commandOutput string) int {
|
||||
args := strings.Split(commandOutput, " ")
|
||||
if len(args) != 2 {
|
||||
f.logger.Printf("[WARN] fingerprint.network: Couldn't split LinkSpeed (%s)", commandOutput)
|
||||
f.logger.Warn("couldn't split LinkSpeed output", "output", commandOutput)
|
||||
return 0
|
||||
}
|
||||
|
||||
unit := strings.Replace(args[1], "\r\n", "", -1)
|
||||
value, err := strconv.Atoi(args[0])
|
||||
if err != nil {
|
||||
f.logger.Printf("[WARN] fingerprint.network: Unable to parse LinkSpeed value (%s)", commandOutput)
|
||||
f.logger.Warn("unable to parse LinkSpeed value", "value", commandOutput)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user