Merge pull request #3993 from leoetlino/signal-message

DolphinWX: Print a message when a signal is received
This commit is contained in:
Pierre Bourdon 2016-07-09 20:46:54 +02:00 committed by GitHub
commit ece5de24bc
1 changed files with 5 additions and 1 deletions

View File

@ -537,7 +537,11 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPo
#if defined(__unix__) || defined(__unix) || defined(__APPLE__) #if defined(__unix__) || defined(__unix) || defined(__APPLE__)
struct sigaction sa; struct sigaction sa;
sa.sa_handler = [](int unused) { s_shutdown_signal_received.Set(); }; sa.sa_handler = [](int unused) {
char message[] = "A signal was received. A second signal will force Dolphin to stop.\n";
write(STDERR_FILENO, message, sizeof(message));
s_shutdown_signal_received.Set();
};
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESETHAND; sa.sa_flags = SA_RESETHAND;
sigaction(SIGINT, &sa, nullptr); sigaction(SIGINT, &sa, nullptr);