BugFix - OOMAdjust wrongly runs on all PIDs without a name match

This commit is contained in:
Praneeth Bodduluri 2016-01-20 02:20:36 +05:30
parent b674c2991e
commit 6d391703e2

View File

@ -35,7 +35,7 @@ func (procs *Procs) AdjustOOMPriorityByName(processName string, value int, ignor
// Find the process with the given name
if currProcess, err := process.NewProcess(pid); err != nil {
continue
} else if name, err := currProcess.Name(); err != nil && name != processName {
} else if name, err := currProcess.Name(); err != nil || name != processName {
continue
} else if err := procs.AdjustOOMPriority(int(pid), value, ignoreIfNonZero); err == nil {
found = true