aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cpulimit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cpulimit.c b/src/cpulimit.c
index e02eafc..b031441 100644
--- a/src/cpulimit.c
+++ b/src/cpulimit.c
@@ -89,11 +89,14 @@ static void quit(int sig)
{
//let all the processes continue if stopped
struct list_node *node = NULL;
- for (node=pgroup.proclist->first; node!= NULL; node=node->next) {
- struct process *p = (struct process*)(node->data);
- kill(p->pid, SIGCONT);
+ if (pgroup.proclist != NULL)
+ {
+ for (node = pgroup.proclist->first; node != NULL; node = node->next) {
+ struct process *p = (struct process*)(node->data);
+ kill(p->pid, SIGCONT);
+ }
+ close_process_group(&pgroup);
}
- close_process_group(&pgroup);
//fix ^C little problem
printf("\r");
fflush(stdout);
Un proyecto texto-plano.xyz