Merge branch 'windows_build' of git.openprivacy.ca:cwtch.im/ui into windows_build
the build failed
Details
the build failed
Details
This commit is contained in:
commit
5f5ea56989
|
@ -12,8 +12,8 @@ import (
|
|||
// process matches the expected name, then it is killed.
|
||||
// On windows this uses tasklist...
|
||||
func CheckProcessAndKill(pid uint64, processName string) {
|
||||
log.Debugf("killing: %v", pid)
|
||||
bytes,err := exec.Command("tasklist", "/fi", "\"pid eq "+strconv.Itoa(int(pid))+"\"").Output()
|
||||
log.Debugf("looking up process: %v", pid)
|
||||
bytes,err := exec.Command("tasklist", "/fi", "pid eq "+strconv.Itoa(int(pid))).Output()
|
||||
if err == nil {
|
||||
// Output will be something like this:
|
||||
//
|
||||
|
@ -21,6 +21,8 @@ func CheckProcessAndKill(pid uint64, processName string) {
|
|||
// ========================= ======== ================ =========== ============
|
||||
// process.exe <PID> Services 0 8,936 K
|
||||
lines := strings.Split(string(bytes),"\n")
|
||||
log.Debugf(lines)
|
||||
|
||||
// check for "<process>.exe"
|
||||
if len(lines) >= 3 && strings.HasPrefix(strings.ToLower(strings.TrimSpace(lines[2])),processName+".exe") {
|
||||
Kill(pid)
|
||||
|
|
Reference in New Issue