Give a potential handleFatalSignal() time do its job

Sleep a second before exiting in case we get a fatal signal just when
about to finish, which sadly seems to happen often. (In fact, if
handleFatalSignal() is running at the same time, it will kill the
process so we never get to the _Exit() call.)
This commit is contained in:
Tor Lillqvist 2016-04-08 15:22:52 +03:00
parent fb0f31d2e8
commit f7612b989a

View file

@ -1076,6 +1076,10 @@ void lokit_main(const std::string& childRoot,
Log::error(std::string("Exception: ") + exc.what());
}
// Sleep a second here in case we get a fatal signal just when about to finish up, which sadly
// seems to happen often, so that the fatalSignalHandler in Util.cpp has time to produce a
// backtrace.
sleep(1);
Log::info("Process finished.");
std::_Exit(Application::EXIT_OK);
}