diff options
author | SmallJoker <mk939@ymail.com> | 2015-04-21 19:54:14 +0200 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-04-22 13:48:10 +1000 |
commit | 17a173f474eed3b43525d669749b4d20a5cd2ec4 (patch) | |
tree | f8d7818900fd15fae92cee9a1cc5eed6e21b30af /src/porting.cpp | |
parent | 3be9787e64362b8a5020746220c65abbe31f8097 (diff) | |
download | minetest-17a173f474eed3b43525d669749b4d20a5cd2ec4.tar.gz minetest-17a173f474eed3b43525d669749b4d20a5cd2ec4.tar.bz2 minetest-17a173f474eed3b43525d669749b4d20a5cd2ec4.zip |
Fix crash on startup (Windows)
Diffstat (limited to 'src/porting.cpp')
-rw-r--r-- | src/porting.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/porting.cpp b/src/porting.cpp index 8ea61f7cc..ce35fe577 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -75,8 +75,7 @@ bool * signal_handler_killstatus(void) void sigint_handler(int sig) { - if(g_killed == false) - { + if(!g_killed) { dstream<<DTIME<<"INFO: sigint_handler(): " <<"Ctrl-C pressed, shutting down."<<std::endl; @@ -86,9 +85,7 @@ void sigint_handler(int sig) debug_stacks_print();*/ g_killed = true; - } - else - { + } else { (void)signal(SIGINT, SIG_DFL); } } @@ -126,7 +123,7 @@ BOOL WINAPI event_handler(DWORD sig) void signal_handler_init(void) { - SetConsoleCtrlHandler( (PHANDLER_ROUTINE)event_handler,TRUE); + SetConsoleCtrlHandler((PHANDLER_ROUTINE)event_handler, TRUE); } #endif @@ -306,14 +303,14 @@ std::string get_sysinfo() oss << "Windows/" << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; - if(osvi.szCSDVersion[0]) + if (osvi.szCSDVersion[0]) oss << "-" << tmp; oss << " "; #ifdef _WIN64 oss << "x86_64"; #else BOOL is64 = FALSE; - if(IsWow64Process(GetCurrentProcess(), &is64) && is64) + if (IsWow64Process(GetCurrentProcess(), &is64) && is64) oss << "x86_64"; // 32-bit app on 64-bit OS else oss << "x86"; @@ -598,7 +595,7 @@ void initializePaths() getExecPathFromProcfs(buf, sizeof(buf)); if (success) { - pathRemoveFile(buf, '/'); + pathRemoveFile(buf, DIR_DELIM_CHAR); std::string execpath(buf); path_share = execpath + DIR_DELIM ".."; |