Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong logic in matching the process name #108

Open
HiGarfield opened this issue Apr 18, 2022 · 0 comments
Open

Wrong logic in matching the process name #108

HiGarfield opened this issue Apr 18, 2022 · 0 comments

Comments

@HiGarfield
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant