aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libexecinfo/10-execinfo.patch
diff options
context:
space:
mode:
authorPhilipp Andronov <filipp.andronov@gmail.com>2015-05-16 09:31:06 +0000
committerBartłomiej Piotrowski <b@bpiotrowski.pl>2015-06-19 12:06:57 +0200
commitcfd1b987c1a3fb7bba7da7a59cb2ba016ac25df7 (patch)
treea3881b0d719a9b48b657ded1bfeb45b7c666326a /testing/libexecinfo/10-execinfo.patch
parent3df0fba36503542dd49e7dada7ed2399e5150684 (diff)
downloadaports-cfd1b987c1a3fb7bba7da7a59cb2ba016ac25df7.tar.gz
aports-cfd1b987c1a3fb7bba7da7a59cb2ba016ac25df7.tar.bz2
aports-cfd1b987c1a3fb7bba7da7a59cb2ba016ac25df7.tar.xz
testing/libexecinfo: new aport
http://www.freshports.org/devel/libexecinfo A quick-n-dirty BSD licensed clone of the GNU libc backtrace facility. This package is a dependency of incoming MongoDB package.
Diffstat (limited to 'testing/libexecinfo/10-execinfo.patch')
-rw-r--r--testing/libexecinfo/10-execinfo.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/testing/libexecinfo/10-execinfo.patch b/testing/libexecinfo/10-execinfo.patch
new file mode 100644
index 0000000000..03b5af0ca2
--- /dev/null
+++ b/testing/libexecinfo/10-execinfo.patch
@@ -0,0 +1,64 @@
+--- execinfo.c.orig
++++ execinfo.c
+@@ -69,7 +69,8 @@
+ char **
+ backtrace_symbols(void *const *buffer, int size)
+ {
+- int i, clen, alen, offset;
++ size_t clen, alen;
++ int i, offset;
+ char **rval;
+ char *cp;
+ Dl_info info;
+@@ -78,7 +79,6 @@
+ rval = malloc(clen);
+ if (rval == NULL)
+ return NULL;
+- (char **)cp = &(rval[size]);
+ for (i = 0; i < size; i++) {
+ if (dladdr(buffer[i], &info) != 0) {
+ if (info.dli_sname == NULL)
+@@ -92,14 +92,14 @@
+ 2 + /* " <" */
+ strlen(info.dli_sname) + /* "function" */
+ 1 + /* "+" */
+- D10(offset) + /* "offset */
++ 10 + /* "offset */
+ 5 + /* "> at " */
+ strlen(info.dli_fname) + /* "filename" */
+ 1; /* "\0" */
+ rval = realloc_safe(rval, clen + alen);
+ if (rval == NULL)
+ return NULL;
+- snprintf(cp, alen, "%p <%s+%d> at %s",
++ snprintf((char *) rval + clen, alen, "%p <%s+%d> at %s",
+ buffer[i], info.dli_sname, offset, info.dli_fname);
+ } else {
+ alen = 2 + /* "0x" */
+@@ -108,12 +108,15 @@
+ rval = realloc_safe(rval, clen + alen);
+ if (rval == NULL)
+ return NULL;
+- snprintf(cp, alen, "%p", buffer[i]);
++ snprintf((char *) rval + clen, alen, "%p", buffer[i]);
+ }
+- rval[i] = cp;
+- cp += alen;
++ rval[i] = (char *) clen;
++ clen += alen;
+ }
+
++ for (i = 0; i < size; i++)
++ rval[i] += (long) rval;
++
+ return rval;
+ }
+
+@@ -155,6 +158,6 @@
+ return;
+ snprintf(buf, len, "%p\n", buffer[i]);
+ }
+- write(fd, buf, len - 1);
++ write(fd, buf, strlen(buf));
+ }
+ }