74 lines
2.3 KiB
Diff
74 lines
2.3 KiB
Diff
--- a/zfuncs.cc
|
|
+++ b/zfuncs.cc
|
|
@@ -19,6 +19,9 @@
|
|
*********************************************************************************/
|
|
|
|
#include "zfuncs.h"
|
|
+#ifdef __GLIBC__
|
|
+#include <execinfo.h>
|
|
+#endif
|
|
|
|
/********************************************************************************
|
|
|
|
@@ -714,12 +717,14 @@ void zexit(int popup, ch *errmess, ...)
|
|
|
|
void zbacktrace()
|
|
{
|
|
+#ifdef __GLIBC__
|
|
int nstack = 100;
|
|
void *stacklist[100];
|
|
|
|
nstack = backtrace(stacklist,nstack); // get backtrace data
|
|
if (nstack > 100) nstack = 100;
|
|
backtrace_symbols_fd(stacklist,nstack,STDOUT_FILENO); // backtrace records to STDOUT
|
|
+#endif
|
|
|
|
return;
|
|
}
|
|
@@ -766,7 +771,11 @@ void zappcrash(ch *format, ... )
|
|
arch, OS2, OS3, zappvers, build_date_time, message);
|
|
Plog(0,"*** zappcrash context: %s | %s \n",zappcrash_context1, zappcrash_context2);
|
|
|
|
+#ifdef __GLIBC__
|
|
nstack = backtrace(stacklist,nstack); // get backtrace data
|
|
+#else
|
|
+ nstack = 0;
|
|
+#endif
|
|
if (nstack <= 0) zexit(0,"zappcrash backtrace() failure");
|
|
if (nstack > 100) nstack = 100;
|
|
|
|
@@ -774,7 +783,9 @@ void zappcrash(ch *format, ... )
|
|
if (! fid1) zexit(0,"zappcrash fopen() failure");
|
|
|
|
fd = fileno(fid1);
|
|
+#ifdef __GLIBC__
|
|
backtrace_symbols_fd(stacklist,nstack,fd); // write backtrace data
|
|
+#endif
|
|
fclose(fid1); // (use of malloc() is avoided)
|
|
|
|
fid1 = fopen("zbacktrace","r"); // open backtrace data file
|
|
--- a/f.file.cc
|
|
+++ b/f.file.cc
|
|
@@ -3755,9 +3755,10 @@ int find_imagefiles(ch *folder, int flag
|
|
if (flags & 16) Frecurse = 1;
|
|
if (flags & 32) Fnolinks = 1;
|
|
|
|
+#ifdef GLOB_ONLYDIR
|
|
if (Fdirs && ! Fimages && ! Fthumbs)
|
|
globflags += GLOB_ONLYDIR;
|
|
-
|
|
+#endif
|
|
globdata.gl_pathc = 0; // glob() setup
|
|
globdata.gl_offs = 0;
|
|
globdata.gl_pathc = 0;
|
|
--- a/zfuncs.h
|
|
+++ b/zfuncs.h
|
|
@@ -37,7 +37,6 @@
|
|
#include <fcntl.h>
|
|
#include <pthread.h>
|
|
#include <signal.h>
|
|
-#include <execinfo.h>
|
|
#include <locale.h>
|
|
#include <glob.h>
|
|
#include <gtk/gtk.h>
|