aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Marletta <angelo.marletta@gmail.com>2012-07-08 06:20:33 -0700
committerAngelo Marletta <angelo.marletta@gmail.com>2012-07-08 06:20:33 -0700
commit1404058b25d2937e1bd054fb731acf9f97e03566 (patch)
tree7f6cc8e15856e9c6e1b547582cc914a8836e1416
parentf209b181a28f7a56334f24c22e32eb06a41c6d3c (diff)
parentd1bd2ee8b6f044a87c981dcad91535bc0ffc5cd6 (diff)
downloadcpulimit-1404058b25d2937e1bd054fb731acf9f97e03566.tar.gz
Merge pull request #13 from opsengine/issue_8
Option --ignore-children replaced with --include-children
-rw-r--r--src/cpulimit.c12
1 files 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);
Un proyecto texto-plano.xyz