Skip to content

Commit

Permalink
Merge #1114
Browse files Browse the repository at this point in the history
1114: Close mir_demo_client_wayland_egl_spinner on SIGTERM r=Saviq a=AlanGriffiths

Close mir_demo_client_wayland_egl_spinner on SIGTERM. (Fixes: #1112)

Co-authored-by: Alan Griffiths <[email protected]>
  • Loading branch information
bors[bot] and AlanGriffiths committed Dec 3, 2019
1 parent fa4cfaf commit 6ac9df8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/miral-shell/spinner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@

#include "spinner/splash.h"
#include <wayland-client.h>
#include <csignal>

static void shutdown(int)
{
exit(EXIT_SUCCESS);
}

int main()
{
struct sigaction action;
action.sa_handler = shutdown;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
sigaction(SIGINT, &action, NULL);
sigaction(SIGTERM, &action, NULL);

SpinnerSplash spinner;

auto const display = wl_display_connect(nullptr);
Expand Down

0 comments on commit 6ac9df8

Please sign in to comment.