aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbhackerozzo <bhackerozzo@3b445381-d045-0410-9223-e17ecdb95f4b>2008-08-29 23:03:05 +0000
committerbhackerozzo <bhackerozzo@3b445381-d045-0410-9223-e17ecdb95f4b>2008-08-29 23:03:05 +0000
commitf4fc87742f56e4c05b9340bb6eb99cd667483dcd (patch)
tree1a524dc87e2ce42e114da920c98afe48f675b0d4
parent794f9410a52b21e8bcedeecedc7f8737daee5418 (diff)
downloadcpulimit-f4fc87742f56e4c05b9340bb6eb99cd667483dcd.tar.gz
resolved bug in non-command mode
-rw-r--r--cpulimit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cpulimit.c b/cpulimit.c
index 2c95850..6b41c34 100644
--- a/cpulimit.c
+++ b/cpulimit.c
@@ -493,18 +493,19 @@ int main(int argc, char **argv) {
freopen( "/dev/null", "w", stdout);
freopen( "/dev/null", "w", stderr);
limit_process(child, limit);
+ //exit(0);
}
else {
//child code
int ret = execvp(cmd, cmd_args);
//if we are here there was an error, show it
perror("Error");
- exit(ret);
+ _exit(ret);
}
return 0;
}
- while(!lazy) {
+ do {
//look for the target process..or wait for it
pid_t ret = 0;
if (pid_ok) {
@@ -540,8 +541,8 @@ int main(int argc, char **argv) {
limit_process(pid, limit);
}
sleep(2);
- }
+ } while(!lazy);
- return 0;
+ exit(0);
}
Un proyecto texto-plano.xyz