summaryrefslogtreecommitdiffstats
path: root/testing/cpulimit/fix-crash-on-sigquit.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-09-27 08:18:35 +0300
committerTimo Teräs <timo.teras@iki.fi>2012-09-27 08:19:07 +0300
commit28ee13d5548a66193baeb2dbbf5254c04c7f21fa (patch)
tree4a408cff8c75d4fd90af16eee7b1f2345b85d663 /testing/cpulimit/fix-crash-on-sigquit.patch
parentac23a63b4f2bf426c9e01b7d800fd46b98804797 (diff)
downloadaports-28ee13d5548a66193baeb2dbbf5254c04c7f21fa.tar.bz2
aports-28ee13d5548a66193baeb2dbbf5254c04c7f21fa.tar.xz
testing/cpulimit: fix a crash under certain conditions
Diffstat (limited to 'testing/cpulimit/fix-crash-on-sigquit.patch')
-rw-r--r--testing/cpulimit/fix-crash-on-sigquit.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/cpulimit/fix-crash-on-sigquit.patch b/testing/cpulimit/fix-crash-on-sigquit.patch
new file mode 100644
index 000000000..d406dec2e
--- /dev/null
+++ b/testing/cpulimit/fix-crash-on-sigquit.patch
@@ -0,0 +1,27 @@
+Only in cpulimit.fix/: core
+Only in cpulimit.fix/: src/cpulimit
+--- cpulimit/src/cpulimit.c
++++ cpulimit.fix/src/cpulimit.c
+@@ -89,11 +89,13 @@
+ {
+ //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) {
++ 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);
+Only in cpulimit.fix/: src/list.o
+Only in cpulimit.fix/: src/process_group.o
+Only in cpulimit.fix/: src/process_iterator.o
+Only in cpulimit.fix/: tests/busy
+Only in cpulimit.fix/: tests/process_iterator_test