summaryrefslogtreecommitdiff
path: root/sys-apps/netplug
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
commitb7ebc951da8800f711142f69d9d958bde67a112d (patch)
treee318514216845acb8f2e49fff7a5cba4027e9d91 /sys-apps/netplug
parentdc7cbdfa65fd814b3b9aa3c56257da201109e807 (diff)
gentoo resync : 28.04.2019
Diffstat (limited to 'sys-apps/netplug')
-rw-r--r--sys-apps/netplug/Manifest3
-rw-r--r--sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch65
-rw-r--r--sys-apps/netplug/netplug-1.2.9.2-r3.ebuild (renamed from sys-apps/netplug/netplug-1.2.9.2-r1.ebuild)34
3 files changed, 89 insertions, 13 deletions
diff --git a/sys-apps/netplug/Manifest b/sys-apps/netplug/Manifest
index f3a12497e2e9..f17a73c65584 100644
--- a/sys-apps/netplug/Manifest
+++ b/sys-apps/netplug/Manifest
@@ -1,8 +1,9 @@
AUX netplug-1.2.9-ignore-wireless.patch 938 BLAKE2B 0c1b720ddae54fca0b313da21fb0af9222ecc494dcc7e4da3fa8d70269b1e6e02cd856b23d3760506aa0b2c6064779e74835af2739bfc7a2ed245ec5ce1194d2 SHA512 a045d1a1dfc6d29334aff6ec035244d68e80887bb05f79d0512c87d7ac0dbb3cdf866569762e575b13a6306604e85e0ba951f10d54f88a39ef558ce2a65ddbed
AUX netplug-1.2.9-remove-nest.patch 5516 BLAKE2B 08452daf4d9966abaf7ec628c7a70357bc42ee357c8584797a2316c2d5876f01824c2eb57cbf759480e558465dac4ab1fc2acfc2db89160c7dce8a9abfd34841 SHA512 dfcb72f1977cefbdb231c0e7a1ab758e9c753c434d9e5ccc5336a7f606e787fcec943cd1055481d1ba9f2ce9da0e33bf93852a106eeda4b2539d0c66c433945b
AUX netplug-1.2.9.2-downandout.patch 340 BLAKE2B b4089082011cfabc2f91b6480332e2ade7997036896309c12489e0dc8369ddbf7bcd52c0c98c03c54731b8a11c5553483eb48762cdbe9b76c6b72edc032b3b27 SHA512 b1b7e99afda7988245f574c7ecffcf50f78493be71290d0484f0df2c94580f25ee3037db01d5fc2e577a2cd1ec721f93663bce3e1b59dcb38dd009a133d034f8
+AUX netplug-1.2.9.2-multi-waitpid-sigchld.patch 1865 BLAKE2B c70d7fbf21c27bdaf7043446f7808f8d078e2fbf914f2ee5119ac25628b597e0e0c5e2a35108eff008155757716955b1652163a20dccc6f5709a8c31ebabbcf8 SHA512 d3be3f90e1f676e68e14e54491c832bdd739b44a79290f2c134d8f579e1de03c2c0d6af065a1d255a55247a8bc18e74c713514e549163bb9804d7e2dc124ad64
AUX netplug-2 715 BLAKE2B df2ffc7a904a86bedb5c160ad0ba8a2d49a8125ed3042f85a361a6270ab79668cdb4dd693e022908b2637a4522f8038f22c0c03b19909d1cdaca2e7da0da21ae SHA512 11efb8b8916d40615840c5721aba089dc9f81bf30f2af6f47d6df2fd8f2b6f22e0cd59ebd37fd9875c4af31e064128e93acbef5cf859b3cabb553fbdd2f3c9ee
DIST netplug-1.2.9.2.tar.bz2 22332 BLAKE2B 3a4232178e782417e30da3dc33361c4043d5ff9bb610c2f9a82281d395af470ddeab9cf12f91ef4a18f4fe6ff49f85b7015fecc7018b1b561e2e7f179d8d206b SHA512 b68a00eb8874ec7dd6aa9f7b7f529a6e1d9ecece4b798c8cee996b7f3534c556656f642de0ac4b2a6d06fbaf18e3bfaab00934a9292b95939a4935e673e9ca8c
-EBUILD netplug-1.2.9.2-r1.ebuild 1291 BLAKE2B 4d56bc811038d0727f0abaf838dee5e4df946ba0a26578dc74ba55a68b8c83cb1a8c2348d2e39225e7efd6ff57f78fbeed233c12883f227325af461a04edfb05 SHA512 09767a936ea26835db3f3db8e5106ad38a8711dc40bc4e1f021820ca77933c910747d9cf573202b9d59869d434687c2663c00dea63923785a92028724f413e76
EBUILD netplug-1.2.9.2-r2.ebuild 1377 BLAKE2B 1ae7cc9e0b60712758d738334291d77c70f3f80da431767cea67b1a679aba91a73359f131b7be0f110fdd8062a103716e970026a83c40f2980d9752107dd73c1 SHA512 33cc9f8c2eff68ef1ea16873db91aa7116aa2fbecd540a100f5db38bcd3421e242e0f5b5272e386d5a66ad29f0b90ce9af4f41c4e548aa171b35e9ac0526183f
+EBUILD netplug-1.2.9.2-r3.ebuild 1482 BLAKE2B e8824dcc19b0bcf8ea470ad12f9397bc0daed15a2dc290496e05be3a6ce3b25475f1b6a085dc1fb6d7e0610412aa7bd01e41a1559f31a103d3961d92fc8560a3 SHA512 88cada59afc0e373415eb14955141967ebe541bda2f1669354e73cb5018fbca88afb2938be6bf3919050f0878e70c37fdf31d2624c14b6690803fa058d429da0
MISC metadata.xml 367 BLAKE2B 5d55fc1e2c617f0957b0d73d2f1bbe9147989dd5d8827fadbd399c71f4721045db39df680166baacc972db498331e48b29fdb4bbe7b21454c20fcf985c79d77e SHA512 d2cdfcaac3690abf52d3ee9ebd7086815b84802d4918778911b63d4ecb36ac8928178ac7d02ebbf3823ee50ef2917069a20a4cdce319097298d7f66ad15e272c
diff --git a/sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch b/sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch
new file mode 100644
index 000000000000..06e645c1dee9
--- /dev/null
+++ b/sys-apps/netplug/files/netplug-1.2.9.2-multi-waitpid-sigchld.patch
@@ -0,0 +1,65 @@
+# Rework SIGCHLD handler to anticipate multiple children dying while the
+# handler is being executed.
+#
+# Without the patch if multiple SIGCHLD signals are received while the signal
+# handler is being executed, the first will be left in pending state and the
+# extra discarded. Due to the children processing logic in netplugd, the ones
+# which were missed will never be waited, left as zombies.
+#
+# Implementation of the signal handler is following suggested handling in
+# https://www.gnu.org/software/libc/manual/html_node/Merged-Signals.html
+#
+# The patch strives to change only the children wait logic in the signal
+# handler, it doesn't try to enhance write call error handling or the unsafe
+# call to exit/do_log. Also the formatting is left as it was in the original
+# code.
+
+--- a/main.c
++++ b/main.c
+@@ -153,17 +153,29 @@ static int child_handler_pipe[2];
+ static void
+ child_handler(int sig, siginfo_t *info, void *v)
+ {
+- struct child_exit ce;
+- int ret;
+- ssize_t s = 0;
++ int old_errno = errno;
+
+ assert(sig == SIGCHLD);
+
+- ce.pid = info->si_pid;
+- ret = waitpid(info->si_pid, &ce.status, 0);
+- if (ret == info->si_pid)
++ while (1)
+ {
+- s = write(child_handler_pipe[1], &ce, sizeof(ce));
++ pid_t pid;
++ int status;
++
++ do
++ {
++ errno = 0;
++ pid = waitpid(WAIT_ANY, &status, WNOHANG);
++ } while (pid <= 0 && errno == EINTR);
++
++ if (pid <= 0)
++ {
++ break;
++ }
++
++ struct child_exit ce = { .pid = pid, .status = status };
++
++ ssize_t s = write(child_handler_pipe[1], &ce, sizeof(ce));
+
+ if (s == -1)
+ {
+@@ -171,6 +183,9 @@ child_handler(int sig, siginfo_t *info, void *v)
+ exit(1);
+ }
+ }
++
++ errno = old_errno;
++ return;
+ }
+
+ /* Poll the existing interface state, so we can catch any state
diff --git a/sys-apps/netplug/netplug-1.2.9.2-r1.ebuild b/sys-apps/netplug/netplug-1.2.9.2-r3.ebuild
index 969fd2dbc4d3..a452c1ad1c3d 100644
--- a/sys-apps/netplug/netplug-1.2.9.2-r1.ebuild
+++ b/sys-apps/netplug/netplug-1.2.9.2-r3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=7
-inherit eutils toolchain-funcs
+inherit toolchain-funcs
DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
HOMEPAGE="https://www.red-bean.com/~bos/"
@@ -11,34 +11,44 @@ SRC_URI="https://www.red-bean.com/~bos/netplug/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 arm ~mips ppc sparc x86"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="debug doc"
DEPEND="doc? ( app-text/ghostscript-gpl
media-gfx/graphviz )"
RDEPEND=""
+PATCHES=(
+ # Remove nested functions, #116140
+ "${FILESDIR}/${PN}-1.2.9-remove-nest.patch"
+
+ # Ignore wireless events
+ "${FILESDIR}/${PN}-1.2.9-ignore-wireless.patch"
+
+ # Fix DOWNANDOUT problem #599400
+ "${FILESDIR}/${P}-downandout.patch"
+
+ # Wait for multiple children in SIGCHLD handler #631316
+ "${FILESDIR}/${P}-multi-waitpid-sigchld.patch"
+)
+
src_prepare() {
# Remove debug flags from CFLAGS
- if ! use debug; then
+ if ! use debug ; then
sed -i -e "s/ -ggdb3//" Makefile || die
fi
# Remove -O3 and -Werror from CFLAGS
sed -i -e "s/ -O3//" -e "s/ -Werror//" Makefile || die
- # Remove nested functions, #116140
- epatch "${FILESDIR}/${PN}-1.2.9-remove-nest.patch"
-
- # Ignore wireless events
- epatch "${FILESDIR}/${PN}-1.2.9-ignore-wireless.patch"
+ default
}
src_compile() {
tc-export CC
emake CC="${CC}"
- if use doc; then
+ if use doc ; then
emake -C docs/
fi
}
@@ -53,7 +63,7 @@ src_install() {
newexe "${FILESDIR}/netplug-2" netplug
dodir /etc/netplug
- echo "eth*" > "${D}"/etc/netplug/netplugd.conf || die
+ echo "eth*" > "${ED}"/etc/netplug/netplugd.conf || die
dodoc ChangeLog NEWS README TODO