DolphinWX: Print a message when we receive a signal

This makes it clear that sending a signal a second time will force stop
Dolphin (which is useful in case the GUI is deadlocked or otherwise
unable to react to the signal).
This commit is contained in:
Léo Lam 2016-07-09 17:38:27 +02:00
parent 59f4d445bb
commit 90ed048532
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__)
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);
sa.sa_flags = SA_RESETHAND;
sigaction(SIGINT, &sa, nullptr);