Followup to bug 535802, make it work on Linux too by passing around the program name from argv[0]

This commit is contained in:
Benjamin Smedberg 2009-12-18 17:14:53 -05:00
Родитель 235c04a443
Коммит a97f0b3ba3
4 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -2638,7 +2638,7 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
NS_BREAK();
#endif
SetupErrorHandling();
SetupErrorHandling(argv[0]);
#ifdef MOZ_ACCESSIBILITY_ATK
// Reset GTK_MODULES, strip atk-bridge if exists
@ -3660,7 +3660,7 @@ XRE_GetProcessType()
}
void
SetupErrorHandling()
SetupErrorHandling(const char* progname)
{
#ifdef XP_WIN
/* On Windows XPSP3 and Windows Vista if DEP is configured off-by-default
@ -3700,7 +3700,7 @@ SetupErrorHandling()
#endif
#endif
InstallSignalHandlers(argv[0]);
InstallSignalHandlers(progname);
#ifndef WINCE
// Unbuffer stdout, needed for tinderbox tests.

Просмотреть файл

@ -194,6 +194,6 @@ extern GeckoProcessType sChildProcessType;
* Set up platform specific error handling such as suppressing DLL load dialog
* and the JIT debugger on Windows, and install unix signal handlers.
*/
void SetupErrorHandling();
void SetupErrorHandling(const char* progname);
#endif // nsAppRunner_h__

Просмотреть файл

@ -251,7 +251,7 @@ XRE_InitChildProcess(int aArgc,
NS_ENSURE_ARG_POINTER(aArgv);
NS_ENSURE_ARG_POINTER(aArgv[0]);
SetupErrorHandling();
SetupErrorHandling(aArgv[0]);
sChildProcessType = aProcess;

Просмотреть файл

@ -279,9 +279,11 @@ void InstallSignalHandlers(const char *ProgramName)
signal(SIGABRT, abnormal_exit_handler);
#elif defined(CRAWL_STACK_ON_SIGSEGV)
signal(SIGSEGV, ah_crap_handler);
signal(SIGILL, ah_crap_handler);
signal(SIGABRT, ah_crap_handler);
if (!getenv("XRE_NO_WINDOWS_CRASH_DIALOG")) {
signal(SIGSEGV, ah_crap_handler);
signal(SIGILL, ah_crap_handler);
signal(SIGABRT, ah_crap_handler);
}
#endif // CRAWL_STACK_ON_SIGSEGV
/* Install a handler for floating point exceptions and disable them if they occur. */