mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Renamed cc_install to something less cryptic (crashCatcherInstall)
This commit is contained in:
parent
d4d2077174
commit
725cc94210
4 changed files with 7 additions and 7 deletions
|
@ -29,7 +29,7 @@ CS::Editor::Editor (int argc, char **argv)
|
|||
{
|
||||
// install the crash handler as soon as possible. note that the log path
|
||||
// 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();
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ int main(int argc, char**argv)
|
|||
std::cerr.rdbuf (&cerrsb);
|
||||
#endif
|
||||
|
||||
cc_install(argc, argv, (cfgMgr.getLogPath() / "crash.log").string());
|
||||
crashCatcherInstall(argc, argv, (cfgMgr.getLogPath() / "crash.log").string());
|
||||
|
||||
#ifdef __APPLE__
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
stack_t altss;
|
||||
|
@ -474,12 +474,12 @@ static bool is_debugger_present()
|
|||
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())
|
||||
{
|
||||
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;
|
||||
} else
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#endif
|
||||
|
||||
#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
|
||||
inline void cc_install(int, char **) { return 0; }
|
||||
inline void crashCatcherInstall(int, char **, const std::string &crashLogPath) { return 0; }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue