200bed5c06
```sh git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" | while read template; do for p in ${template%/template}/patches/*; do sed -i ' \,^[+-][+-][+-] /dev/null,b /^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b s,^[*][*][*] ,&a/, /^--- /{ s,\(^--- \)\(./\)*,\1a/, s,[.][Oo][Rr][Ii][Gg]\([ /]\),\1, s/[.][Oo][Rr][Ii][Gg]$// s/[.]patched[.]\([^.]\)/.\1/ h } /^+++ -/{ g s/^--- a/+++ b/ b } s,\(^+++ \)\(./\)*,\1b/, ' "$p" done sed -i '/^patch_args=/d' $template done ```
33 lines
717 B
Diff
33 lines
717 B
Diff
diff --git src/util.c src/util.c
|
|
index f2141bd..10e1549 100644
|
|
--- a/src/util.c
|
|
+++ b/src/util.c
|
|
@@ -2,8 +2,9 @@
|
|
|
|
#include <openssl/md5.h>
|
|
#include <uuid/uuid.h>
|
|
-
|
|
+#ifdef __GLIBC__
|
|
#include <execinfo.h>
|
|
+#endif
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
@@ -147,13 +148,15 @@ void exit_failure(void)
|
|
{
|
|
int nptrs;
|
|
void *buffer[BT_BUF_SIZE];
|
|
-
|
|
+#ifdef __GLIBC__
|
|
nptrs = backtrace(buffer, BT_BUF_SIZE);
|
|
+#endif
|
|
fprintf(stderr, "\nOops! HTTPDirFS crashed! :(\n");
|
|
+#ifdef __GLIBC__
|
|
fprintf(stderr, "backtrace() returned the following %d addresses:\n",
|
|
nptrs);
|
|
backtrace_symbols_fd(buffer, nptrs, STDERR_FILENO);
|
|
-
|
|
+#endif
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|