New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MainNoGUI: Shut down cleanly on SIGINT/SIGTERM #4243
Conversation
clang-format really *wants* the two empty lines to be removed; otherwise, it will always flag MemoryUtil as needing formatting changes which is an annoyance when it is used as a git filter driver.
6b47362
to
62e56d1
Compare
62e56d1
to
eaebb36
Compare
Source/Core/DolphinWX/MainNoGUI.cpp, line 372 at r1 (raw file):
Comments from Reviewable |
Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion. Source/Core/DolphinWX/MainNoGUI.cpp, line 372 at r1 (raw file):
|
const char message[] = "A signal was received. A second signal will force Dolphin to stop.\n"; | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wunused-result" | ||
write(STDERR_FILENO, message, sizeof(message)); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -366,6 +368,21 @@ int main(int argc, char* argv[]) | |||
|
|||
platform->Init(); | |||
|
|||
// Shut down cleanly on SIGINT and SIGTERM | |||
struct sigaction sa; | |||
sa.sa_handler = [](int unused) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This is the same as PR dolphin-emu#3991, but for MainNoGUI. nogui/headless will shut down cleanly on SIGINT and SIGTERM, just like it would when closing the render window. The default signal handler will be restored after a first shutdown signal so a second signal will exit Dolphin forcefully.
eaebb36
to
3cbf3ba
Compare
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
This is the same as PR #3991, but for MainNoGUI.
nogui/headless will shut down cleanly on SIGINT and SIGTERM, just like it would when closing the render window.
The default signal handler will be restored after a first shutdown signal so a second signal will exit Dolphin forcefully.
Fixes issue 9423.
This change is