diff options
author | bhackerozzo <bhackerozzo@3b445381-d045-0410-9223-e17ecdb95f4b> | 2008-08-29 23:03:05 +0000 |
---|---|---|
committer | bhackerozzo <bhackerozzo@3b445381-d045-0410-9223-e17ecdb95f4b> | 2008-08-29 23:03:05 +0000 |
commit | f4fc87742f56e4c05b9340bb6eb99cd667483dcd (patch) | |
tree | 1a524dc87e2ce42e114da920c98afe48f675b0d4 | |
parent | 794f9410a52b21e8bcedeecedc7f8737daee5418 (diff) | |
download | cpulimit-f4fc87742f56e4c05b9340bb6eb99cd667483dcd.tar.gz |
resolved bug in non-command mode
-rw-r--r-- | cpulimit.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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); } |