|
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".