pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/libuv libuv: Fix build on NetBSD without KERN_PR...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5e321394fc76
branches:  trunk
changeset: 369841:5e321394fc76
user:      kamil <kamil%pkgsrc.org@localhost>
date:      Fri Oct 06 15:58:15 2017 +0000

description:
libuv: Fix build on NetBSD without KERN_PROC_PATHNAME

Add fallback implementation reading /proc/self/exe to exctract the
executable name.

PR pkg/52597 by Joern Clausen

diffstat:

 devel/libuv/distinfo                        |   3 +-
 devel/libuv/patches/patch-src_unix_netbsd.c |  35 +++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletions(-)

diffs (54 lines):

diff -r e127debb5a3b -r 5e321394fc76 devel/libuv/distinfo
--- a/devel/libuv/distinfo      Fri Oct 06 15:20:42 2017 +0000
+++ b/devel/libuv/distinfo      Fri Oct 06 15:58:15 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.20 2017/10/06 04:22:47 adam Exp $
+$NetBSD: distinfo,v 1.21 2017/10/06 15:58:15 kamil Exp $
 
 SHA1 (libuv-1.15.0.tar.gz) = 13a67a735516b2ec638af1d28b0aee07cb73b724
 RMD160 (libuv-1.15.0.tar.gz) = 4ec99f081b755c7670ff86f8f9ede55f9077a112
@@ -7,4 +7,5 @@
 SHA1 (patch-autogen.sh) = a5f48189bfb17624c545a80626ea311b7755d232
 SHA1 (patch-configure.ac) = e6636d522dc9218fc9aee62846426645473cb6cd
 SHA1 (patch-src_unix_fs.c) = 21fffa99df9528aedee0c6fe299d28ff5110d2ba
+SHA1 (patch-src_unix_netbsd.c) = 3386e702e3acc29bba6f3f5f612db728473b2a73
 SHA1 (patch-src_unix_thread.c) = 1ae58ceacc721421019c14eed5830c0a6dcf1768
diff -r e127debb5a3b -r 5e321394fc76 devel/libuv/patches/patch-src_unix_netbsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libuv/patches/patch-src_unix_netbsd.c       Fri Oct 06 15:58:15 2017 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_unix_netbsd.c,v 1.1 2017/10/06 15:58:15 kamil Exp $
+
+--- src/unix/netbsd.c.orig     2017-10-02 23:30:27.000000000 +0000
++++ src/unix/netbsd.c
+@@ -66,6 +66,7 @@ void uv_loadavg(double avg[3]) {
+ 
+ 
+ int uv_exepath(char* buffer, size_t* size) {
++#if defined(KERN_PROC_PATHNAME)
+   /* Intermediate buffer, retrieving partial path name does not work
+    * As of NetBSD-8(beta), vnode->path translator does not handle files
+    * with longer names than 31 characters.
+@@ -93,6 +94,22 @@ int uv_exepath(char* buffer, size_t* siz
+ 
+   /* Set new size. */
+   *size = strlen(buffer);
++#else
++  ssize_t n;
++
++  if (buffer == NULL || size == NULL || *size == 0)
++    return -EINVAL;
++
++  n = *size - 1;
++  if (n > 0)
++    n = readlink("/proc/self/exe", buffer, n);
++
++  if (n == -1)
++    return -errno;
++
++  buffer[n] = '\0';
++  *size = n;
++#endif
+ 
+   return 0;
+ }



Home | Main Index | Thread Index | Old Index