diff --git a/src/breakpad/BreakPad.cpp b/src/breakpad/BreakPad.cpp index b37a2aa09..340792946 100644 --- a/src/breakpad/BreakPad.cpp +++ b/src/breakpad/BreakPad.cpp @@ -18,8 +18,11 @@ #include "BreakPad.h" +#include "config.h" + #include #include +#include #include #define CRASH_REPORTER_BINARY "CrashReporter" @@ -38,8 +41,10 @@ LaunchUploader( const char* dump_dir, const char* minidump_id, void* that, bool return false; const char* crashReporter = static_cast(that)->crashReporter(); - pid_t pid = fork(); + if ( strlen( crashReporter ) == 0 ) + return false; + pid_t pid = fork(); if ( pid == -1 ) // fork failed return false; if ( pid == 0 ) @@ -70,7 +75,14 @@ BreakPad::BreakPad( const QString& path ) : google_breakpad::ExceptionHandler( path.toStdString(), 0, LaunchUploader, this, true, 0 ) #endif { - QString reporter = QString( "%1/%2" ).arg( qApp->applicationDirPath() ).arg( CRASH_REPORTER_BINARY ); + QString reporter; + QString localReporter = QString( "%1/%2" ).arg( qApp->applicationDirPath() ).arg( CRASH_REPORTER_BINARY ); + QString globalReporter = QString( "%1/%2" ).arg( CMAKE_INSTALL_LIBEXECDIR ).arg( CRASH_REPORTER_BINARY ); + + if ( QFileInfo( localReporter ).exists() ) + reporter = localReporter; + else if ( QFileInfo( globalReporter ).exists() ) + reporter = globalReporter; char* creporter; std::string sreporter = reporter.toStdString();