opsengine / cpulimit

CPU usage limiter for Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong logic in matching the process name

HiGarfield opened this issue · comments

if (strncmp(basename(proc.command), process_name, strlen(process_name))==0 && kill(pid,SIGCONT)==0) {

"strncmp" is not a correct way.

For example, if we use "cpulimit -e abc -l 30", then the process with the name "abcd" may be limited.

The correct way is to use "strcmp".