Commit feed8dc4132360c36a87acabb9748c22497de18c
1 parent
a3459b32
Exists in
master
and in
5 other branches
Doin a "clean exit" on SIGTERM.
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
src/pw3270/main.c
| ... | ... | @@ -38,6 +38,10 @@ |
| 38 | 38 | #include <glib.h> |
| 39 | 39 | #include <glib/gstdio.h> |
| 40 | 40 | |
| 41 | +#ifdef G_OS_UNIX | |
| 42 | + #include <glib-unix.h> | |
| 43 | +#endif // G_OS_UNIX | |
| 44 | + | |
| 41 | 45 | #ifdef HAVE_GTKMAC |
| 42 | 46 | #include <gtkosxapplication.h> |
| 43 | 47 | #endif // HAVE_GTKMAC |
| ... | ... | @@ -560,6 +564,11 @@ int main(int argc, char *argv[]) |
| 560 | 564 | |
| 561 | 565 | g_idle_add((GSourceFunc) startup, toplevel); |
| 562 | 566 | |
| 567 | + #ifdef G_OS_UNIX | |
| 568 | + // Termination | |
| 569 | + g_unix_signal_add(SIGTERM, (GSourceFunc) gtk_main_quit, NULL); | |
| 570 | + #endif // G_OS_UNIX | |
| 571 | + | |
| 563 | 572 | gtk_main(); |
| 564 | 573 | |
| 565 | 574 | pw3270_stop_plugins(toplevel); | ... | ... |