aboutsummaryrefslogtreecommitdiffstats
path: root/testing
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
parentac23a63b4f2bf426c9e01b7d800fd46b98804797 (diff)
downloadaports-28ee13d5548a66193baeb2dbbf5254c04c7f21fa.tar.bz2
aports-28ee13d5548a66193baeb2dbbf5254c04c7f21fa.tar.xz
testing/cpulimit: fix a crash under certain conditions
Diffstat (limited to 'testing')
-rw-r--r--testing/cpulimit/APKBUILD8
-rw-r--r--testing/cpulimit/fix-crash-on-sigquit.patch27
2 files changed, 32 insertions, 3 deletions
diff --git a/testing/cpulimit/APKBUILD b/testing/cpulimit/APKBUILD
index bf9ba76153..9ed2993c5f 100644
--- a/testing/cpulimit/APKBUILD
+++ b/testing/cpulimit/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa
pkgname=cpulimit
pkgver=0.0.2012.06.05
-pkgrel=0
+pkgrel=1
pkgdesc="CPU usage limiter for Linux"
url="https://github.com/opsengine/cpulimit"
arch="all"
@@ -11,7 +11,8 @@ depends_dev=""
makedepends="$depends_dev"
install=""
subpackages=""
-source="http://dev.alpinelinux.org/archive/cpulimit/cpulimit-$pkgver.tar.gz"
+source="http://dev.alpinelinux.org/archive/cpulimit/cpulimit-$pkgver.tar.gz
+ fix-crash-on-sigquit.patch"
_builddir="$srcdir"/cpulimit
prepare() {
@@ -34,4 +35,5 @@ package() {
install -Dm755 src/cpulimit "$pkgdir"/usr/bin/cpulimit
}
-md5sums="34796b9b49c622d1d2b3adb97b3cf965 cpulimit-0.0.2012.06.05.tar.gz"
+md5sums="34796b9b49c622d1d2b3adb97b3cf965 cpulimit-0.0.2012.06.05.tar.gz
+664a233f3057e9c0ad245ef4a72e51cd fix-crash-on-sigquit.patch"
diff --git a/testing/cpulimit/fix-crash-on-sigquit.patch b/testing/cpulimit/fix-crash-on-sigquit.patch
new file mode 100644
index 0000000000..d406dec2e0
--- /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