diff options
Diffstat (limited to 'src/cpulimit.c')
-rw-r--r-- | src/cpulimit.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cpulimit.c b/src/cpulimit.c index 002205d..5c85da2 100644 --- a/src/cpulimit.c +++ b/src/cpulimit.c @@ -88,12 +88,14 @@ int lazy = 0; 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); - } - close_process_group(&pgroup); + if (pgroup.proclist != NULL){ + 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); + } + close_process_group(&pgroup); + } //fix ^C little problem printf("\r"); fflush(stdout); |