net-misc/dhcpcd: Revbump to add two upstream fixes
authorLars Wendler <polynomial-c@gentoo.org>
Sun, 28 Jul 2019 12:07:47 +0000 (14:07 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Sun, 28 Jul 2019 12:07:47 +0000 (14:07 +0200)
- 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@gentoo.org>
net-misc/dhcpcd/dhcpcd-8.0.1-r1.ebuild [moved from net-misc/dhcpcd/dhcpcd-8.0.1.ebuild with 97% similarity]
net-misc/dhcpcd/files/dhcpcd-8.0.1-delete_tmpfiles.patch [new file with mode: 0644]
net-misc/dhcpcd/files/dhcpcd-8.0.1-fix_check_for_open_memstream.patch [new file with mode: 0644]

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 491c778680e3cc615518b9577ecba1c6ea9a1600..6f8f030328ef03ce5db17f867e871fcda2a3ea01 100644 (file)
@@ -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 (file)
index 0000000..0bc625a
--- /dev/null
@@ -0,0 +1,34 @@
+From 79846b358f6ea8d0a6027ee0ba38342a730065b0 Mon Sep 17 00:00:00 2001
+From: Roy Marples <roy@marples.name>
+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 (file)
index 0000000..89ed2af
--- /dev/null
@@ -0,0 +1,27 @@
+From fa7f0d1e0a57bfaca49e1cfdc3d292ef1d68001a Mon Sep 17 00:00:00 2001
+From: Roy Marples <roy@marples.name>
+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
+