Renamed cc_install to something less cryptic (crashCatcherInstall)

pull/457/head
Alexander Stillich 7 years ago
parent d4d2077174
commit 725cc94210

@ -29,7 +29,7 @@ CS::Editor::Editor (int argc, char **argv)
{ {
// install the crash handler as soon as possible. note that the log path // install the crash handler as soon as possible. note that the log path
// does not depend on config being read. // does not depend on config being read.
cc_install(argc, argv, (mCfgMgr.getLogPath() / "openmw-cs-crash.log").string()); crashCatcherInstall(argc, argv, (mCfgMgr.getLogPath() / "openmw-cs-crash.log").string());
std::pair<Files::PathContainer, std::vector<std::string> > config = readConfig(); std::pair<Files::PathContainer, std::vector<std::string> > config = readConfig();

@ -328,7 +328,7 @@ int main(int argc, char**argv)
std::cerr.rdbuf (&cerrsb); std::cerr.rdbuf (&cerrsb);
#endif #endif
cc_install(argc, argv, (cfgMgr.getLogPath() / "crash.log").string()); crashCatcherInstall(argc, argv, (cfgMgr.getLogPath() / "crash.log").string());
#ifdef __APPLE__ #ifdef __APPLE__
boost::filesystem::path binary_path = boost::filesystem::system_complete(boost::filesystem::path(argv[0])); boost::filesystem::path binary_path = boost::filesystem::system_complete(boost::filesystem::path(argv[0]));

@ -406,7 +406,7 @@ static void crash_handler(const char *logfile)
exit(0); exit(0);
} }
int cc_install_handlers(int argc, char **argv, int num_signals, int *signals, const char *logfile, int (*user_info)(char*, char*)) int crashCatcherInstallHandlers(int argc, char **argv, int num_signals, int *signals, const char *logfile, int (*user_info)(char*, char*))
{ {
struct sigaction sa; struct sigaction sa;
stack_t altss; stack_t altss;
@ -474,12 +474,12 @@ static bool is_debugger_present()
return false; return false;
} }
void cc_install(int argc, char **argv, const std::string &crashLogPath) void crashCatcherInstall(int argc, char **argv, const std::string &crashLogPath)
{ {
if ((argc == 2 && strcmp(argv[1], "--cc-handle-crash") == 0) || !is_debugger_present()) if ((argc == 2 && strcmp(argv[1], "--cc-handle-crash") == 0) || !is_debugger_present())
{ {
int s[5] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS, SIGABRT }; int s[5] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS, SIGABRT };
if (cc_install_handlers(argc, argv, 5, s, crashLogPath.c_str(), NULL) == -1) if (crashCatcherInstallHandlers(argc, argv, 5, s, crashLogPath.c_str(), NULL) == -1)
{ {
std::cerr << "Installing crash handler failed" << std::endl; std::cerr << "Installing crash handler failed" << std::endl;
} else } else

@ -10,9 +10,9 @@
#endif #endif
#if USE_CRASH_CATCHER #if USE_CRASH_CATCHER
extern void cc_install(int argc, char **argv, const std::string &crashLogPath); extern void crashCatcherInstall(int argc, char **argv, const std::string &crashLogPath);
#else #else
inline void cc_install(int, char **) { return 0; } inline void crashCatcherInstall(int, char **, const std::string &crashLogPath) { return 0; }
#endif #endif
#endif #endif

Loading…
Cancel
Save