Ticket #29148: 0001-miredo-fix-crash.patch

File 0001-miredo-fix-crash.patch, 1.9 KB (added by l2dy (Zero King), 8 years ago)
  • net/miredo/Portfile

    From bb2ee61500fe1a537d3a77f2c3bbb96ffeb244ac Mon Sep 17 00:00:00 2001
    From: Zero King <l2dy@macports.org>
    Date: Fri, 10 Mar 2017 06:47:10 +0000
    Subject: [PATCH] miredo: fix crash
    
    ---
     net/miredo/Portfile                            |  3 ++-
     net/miredo/files/patch-compat-closefrom.c.diff | 22 ++++++++++++++++++++++
     2 files changed, 24 insertions(+), 1 deletion(-)
     create mode 100644 net/miredo/files/patch-compat-closefrom.c.diff
    
    diff --git a/net/miredo/Portfile b/net/miredo/Portfile
    index 562fbcac31..bab16ca58c 100644
    a b PortSystem 1.0 
    44
    55name                miredo
    66version             1.2.6
     7revision            1
    78maintainers         {l2dy @l2dy} openmaintainer
    89
    910categories          net
    use_xz yes 
    2425checksums           rmd160  b02b96f233df2211f45c0dad981f0a5ab6aa1789 \
    2526                    sha256  fa26d2f4a405415833669e2e2e22677b225d8f83600844645d5683535ea43149
    2627
    27 patchfiles          patch-nosignal.diff
     28patchfiles          patch-nosignal.diff patch-compat-closefrom.c.diff
    2829use_parallel_build  no
    2930
    3031depends_lib-append  port:judy port:tuntaposx
  • new file net/miredo/files/patch-compat-closefrom.c.diff

    diff --git a/net/miredo/files/patch-compat-closefrom.c.diff b/net/miredo/files/patch-compat-closefrom.c.diff
    new file mode 100644
    index 0000000000..06ef9873e4
    - +  
     1--- compat/closefrom.c.orig
     2+++ compat/closefrom.c
     3@@ -27,6 +27,7 @@
     4 #include <sys/time.h> /* for <sys/resource.h> */
     5 #include <sys/resource.h> /* getrlimit() */
     6 #include <unistd.h>
     7+#include <fcntl.h>
     8 #include <errno.h> /* errno */
     9 #include <sys/select.h> /* FD_SETSIZE */
     10 
     11@@ -74,7 +75,11 @@
     12        }
     13 
     14        while ((unsigned)fd < lim.rlim_max)
     15+#ifdef __APPLE__
     16+               if (fcntl (fd++, F_SETFD, FD_CLOEXEC) != -1)
     17+#else
     18                if (close (fd++) == 0)
     19+#endif
     20                        found++;
     21 
     22        if (found == 0)