Fix -Wunused-result warnings

This commit is contained in:
Léo Lam
2016-10-22 19:08:17 +02:00
parent df76f2910b
commit 68156a02ed
2 changed files with 18 additions and 7 deletions

View File

@ -290,6 +290,17 @@ static BOOL WINAPI s_ctrl_handler(DWORD fdwCtrlType)
}
#endif
#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
static void SignalHandler(int)
{
const char message[] = "A signal was received. A second signal will force Dolphin to stop.\n";
if (write(STDERR_FILENO, message, sizeof(message)) < 0)
{
}
s_shutdown_signal_received.Set();
}
#endif
CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geometry,
bool use_debugger, bool batch_mode, bool show_log_window, long style)
: CRenderFrame(parent, id, title, wxDefaultPosition, wxSize(800, 600), style),
@ -445,11 +456,7 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
struct sigaction sa;
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();
};
sa.sa_handler = SignalHandler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESETHAND;
sigaction(SIGINT, &sa, nullptr);