File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -253,9 +253,15 @@ void qgisCrash( int signal )
253
253
{
254
254
// take full stacktrace using gdb
255
255
// http://stackoverflow.com/questions/3151779/how-its-better-to-invoke-gdb-from-program-to-print-its-stacktrace
256
+ // unfortunately, this is not so simple. the proper method is way more OS-specific
257
+ // than this code would suggest, see http://stackoverflow.com/a/1024937
256
258
257
259
char exename[512 ];
260
+ #if defined(__FreeBSD__)
261
+ int len = readlink ( " /proc/curproc/file" , exename, sizeof ( exename ) - 1 );
262
+ #else
258
263
int len = readlink ( " /proc/self/exe" , exename, sizeof ( exename ) - 1 );
264
+ #endif
259
265
if ( len < 0 )
260
266
{
261
267
myPrint ( " Could not read link (%d:%s)\n " , errno, strerror ( errno ) );
You can’t perform that action at this time.
0 commit comments