diff options
-rw-r--r-- | testing/cpulimit/APKBUILD | 8 | ||||
-rw-r--r-- | testing/cpulimit/fix-crash-on-sigquit.patch | 27 |
2 files changed, 32 insertions, 3 deletions
diff --git a/testing/cpulimit/APKBUILD b/testing/cpulimit/APKBUILD index bf9ba7615..9ed2993c5 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 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 |