commit: 6cae10d027eea537089030d23fdfce63c4206952
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 28 12:07:47 2019 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Jul 28 12:07:47 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cae10d0
net-misc/dhcpcd: Revbump to add two upstream fixes
- script: ensure that tmp files are removed
- configure: Fix test for open_memstream
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
...{dhcpcd-8.0.1.ebuild => dhcpcd-8.0.1-r1.ebuild} | 5 ++++
.../files/dhcpcd-8.0.1-delete_tmpfiles.patch | 34 ++++++++++++++++++++++
...dhcpcd-8.0.1-fix_check_for_open_memstream.patch | 27 +++++++++++++++++
3 files changed, 66 insertions(+)
diff --git a/net-misc/dhcpcd/dhcpcd-8.0.1.ebuild
b/net-misc/dhcpcd/dhcpcd-8.0.1-r1.ebuild
similarity index 97%
rename from net-misc/dhcpcd/dhcpcd-8.0.1.ebuild
rename to net-misc/dhcpcd/dhcpcd-8.0.1-r1.ebuild
index 491c778680e..6f8f030328e 100644
--- a/net-misc/dhcpcd/dhcpcd-8.0.1.ebuild
+++ b/net-misc/dhcpcd/dhcpcd-8.0.1-r1.ebuild
@@ -27,6 +27,11 @@ COMMON_DEPEND="udev? ( virtual/udev )"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}"
+PATCHES=(
+ "${FILESDIR}/${P}-delete_tmpfiles.patch"
+ "${FILESDIR}/${P}-fix_check_for_open_memstream.patch"
+)
+
src_configure() {
local myeconfargs=(
--dbdir="${EPREFIX}/var/lib/dhcpcd"
diff --git a/net-misc/dhcpcd/files/dhcpcd-8.0.1-delete_tmpfiles.patch
b/net-misc/dhcpcd/files/dhcpcd-8.0.1-delete_tmpfiles.patch
new file mode 100644
index 00000000000..0bc625ac11d
--- /dev/null
+++ b/net-misc/dhcpcd/files/dhcpcd-8.0.1-delete_tmpfiles.patch
@@ -0,0 +1,34 @@
+From 79846b358f6ea8d0a6027ee0ba38342a730065b0 Mon Sep 17 00:00:00 2001
+From: Roy Marples <[email protected]>
+Date: Sun, 28 Jul 2019 11:49:17 +0100
+Subject: script: ensure that tmp files are removed
+
+fopen creates a new stream which will use a new fd.
+Why using fdopen, the new stream will use the same fd, so when
+it's closed the tmp file will really unlink.
+---
+ src/script.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/script.c b/src/script.c
+index 1863a661..74aef1b1 100644
+--- a/src/script.c
++++ b/src/script.c
+@@ -213,10 +213,11 @@ make_env(const struct interface *ifp, const char *reason)
+ if (tmpfd == -1)
+ goto eexit;
+ unlink(tmpfile);
+- fp = fopen(tmpfile, "w+");
+- close(tmpfd);
+- if (fp == NULL)
++ fp = fdopen(tmpfd, "w+");
++ if (fp == NULL) {
++ close(tmpfd);
+ goto eexit;
++ }
+ #endif
+
+ #ifdef INET
+--
+cgit v1.2.1
+
diff --git
a/net-misc/dhcpcd/files/dhcpcd-8.0.1-fix_check_for_open_memstream.patch
b/net-misc/dhcpcd/files/dhcpcd-8.0.1-fix_check_for_open_memstream.patch
new file mode 100644
index 00000000000..89ed2afa987
--- /dev/null
+++ b/net-misc/dhcpcd/files/dhcpcd-8.0.1-fix_check_for_open_memstream.patch
@@ -0,0 +1,27 @@
+From fa7f0d1e0a57bfaca49e1cfdc3d292ef1d68001a Mon Sep 17 00:00:00 2001
+From: Roy Marples <[email protected]>
+Date: Sun, 28 Jul 2019 12:53:03 +0100
+Subject: configure: Fix test for open_memstream
+
+glibc-2.19 needs the return value testing....
+---
+ configure | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index d25eec56..50058520 100755
+--- a/configure
++++ b/configure
+@@ -747,8 +747,7 @@ if [ -z "$OPEN_MEMSTREAM" ]; then
+ cat <<EOF >_open_memstream.c
+ #include <stdio.h>
+ int main(void) {
+- open_memstream(NULL, NULL);
+- return 0;
++ return open_memstream(NULL, NULL) != NULL ? 0 : 1;
+ }
+ EOF
+ if $XCC _open_memstream.c -o _open_memstream 2>&3; then
+--
+cgit v1.2.1
+