Skip to content

Commit

Permalink
Fix crash on startup (Windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker authored and Zeno- committed Apr 22, 2015
1 parent 3be9787 commit 17a173f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/porting.cpp
Expand Up @@ -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;

Expand All @@ -86,9 +85,7 @@ void sigint_handler(int sig)
debug_stacks_print();*/

g_killed = true;
}
else
{
} else {
(void)signal(SIGINT, SIG_DFL);
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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 "..";
Expand Down

1 comment on commit 17a173f

@Zeno-
Copy link
Contributor

@Zeno- Zeno- commented on 17a173f Apr 22, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #2642

Please sign in to comment.