ACN Process Management #345

Merged
dan merged 14 commits from torrc into master 2020-10-21 23:58:59 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 582e746795 - Show all commits

View File

@ -22,7 +22,7 @@ func CheckProcessAndKill(pid uint64, processName string) {
// process.exe <PID> Services 0 8,936 K
lines := strings.Split(string(bytes),"\n")
// check for "<process>.exe"
if len(lines) >= 3 && strings.HasPrefix(strings.ToLower(strings.Trim(lines[2])),processName+".exe") {
if len(lines) >= 3 && strings.HasPrefix(strings.ToLower(strings.TrimSpace(lines[2])),processName+".exe") {
Kill(pid)
return
}
@ -43,4 +43,4 @@ func Kill(pid uint64) {
log.Debugf("could not kill pid: %v %v", pid, err)
}
return
}
}