Skip to content
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

Merged
merged 2 commits into from Sep 26, 2016

Conversation

leoetlino
Copy link
Member

@leoetlino leoetlino commented Sep 24, 2016

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 Reviewable

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.
@leoetlino leoetlino changed the title MainNoGUI: Shut down cleanly on shutdown signal MainNoGUI: Shut down cleanly on SIGINT/SIGTERM Sep 25, 2016
@lioncash
Copy link
Member

Source/Core/DolphinWX/MainNoGUI.cpp, line 372 at r1 (raw file):

  // Shut down cleanly on SIGINT and SIGTERM
  struct sigaction sa;

struct isn't necessary.


Comments from Reviewable

@leoetlino
Copy link
Member Author

Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion.


Source/Core/DolphinWX/MainNoGUI.cpp, line 372 at r1 (raw file):

Previously, lioncash (Mat M.) wrote…

struct isn't necessary.

I know it typically isn't, but it _is_ here because there's a function named sigaction().

Comments from Reviewable

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.

@@ -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.

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.
@degasus degasus merged commit e7aad13 into dolphin-emu:master Sep 26, 2016
@leoetlino leoetlino deleted the signal-headless branch September 26, 2016 12:36
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • rs3-bumpmapping on dx-win-nv: diff

automated-fifoci-reporter

@leoetlino leoetlino mentioned this pull request Oct 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants