From d1bd2ee8b6f044a87c981dcad91535bc0ffc5cd6 Mon Sep 17 00:00:00 2001 From: Angelo Marletta Date: Sun, 8 Jul 2012 14:16:54 +0100 Subject: option --ignore-children replaced with --include-children --- src/cpulimit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpulimit.c b/src/cpulimit.c index 002205d..e02eafc 100644 --- a/src/cpulimit.c +++ b/src/cpulimit.c @@ -113,7 +113,7 @@ static void print_usage(FILE *stream, int exit_code) fprintf(stream, " -l, --limit=N percentage of cpu allowed from 0 to %d (required)\n", 100*NCPU); fprintf(stream, " -v, --verbose show control statistics\n"); fprintf(stream, " -z, --lazy exit if there is no target process, or if it dies\n"); - fprintf(stream, " -i, --ignore-children don't limit children processes\n"); + fprintf(stream, " -i, --include-children limit also the children processes\n"); fprintf(stream, " -h, --help display this help and exit\n"); fprintf(stream, " TARGET must be exactly one of these:\n"); fprintf(stream, " -p, --pid=N pid of the process (implies -z)\n"); @@ -307,7 +307,7 @@ int main(int argc, char **argv) { int pid_ok = 0; int limit_ok = 0; pid_t pid = 0; - int ignore_children = 0; + int include_children = 0; //get program name char *p = (char*)memrchr(argv[0], (unsigned int)'/', strlen(argv[0])); @@ -329,7 +329,7 @@ int main(int argc, char **argv) { { "limit", required_argument, NULL, 'l' }, { "verbose", no_argument, NULL, 'v' }, { "lazy", no_argument, NULL, 'z' }, - { "ignore-children", no_argument, NULL, 'i' }, + { "include-children", no_argument, NULL, 'i' }, { "help", no_argument, NULL, 'h' }, { 0, 0, 0, 0 } }; @@ -356,7 +356,7 @@ int main(int argc, char **argv) { lazy = 1; break; case 'i': - ignore_children = 1; + include_children = 1; break; case 'h': print_usage(stdout, 1); @@ -466,7 +466,7 @@ int main(int argc, char **argv) { else { //limiter code if (verbose) printf("Limiting process %d\n",child); - limit_process(child, limit, !ignore_children); + limit_process(child, limit, include_children); exit(0); } } @@ -505,7 +505,7 @@ int main(int argc, char **argv) { } printf("Process %d found\n", pid); //control - limit_process(pid, limit, ignore_children); + limit_process(pid, limit, include_children); } if (lazy) break; sleep(2); -- cgit v1.2.3