Contents of /trunk/xmms/patches/xmms-1.2.10-sigterm.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1065 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1065 byte(s)
-import
1 | diff -Naur xmms-1.2.10/xmms/main.c xmms-1.2.10.sigterm/xmms/main.c |
2 | --- xmms-1.2.10/xmms/main.c 2004-02-23 20:31:43.000000000 +0000 |
3 | +++ xmms-1.2.10.sigterm/xmms/main.c 2004-02-25 07:06:50.000000000 +0000 |
4 | @@ -3390,6 +3390,18 @@ |
5 | exit(1); |
6 | } |
7 | |
8 | +/* Try to exit nicely when receiving a nice exit signal */ |
9 | +void sigterm_handler(int sig) |
10 | +{ |
11 | + /* Original author of patch said that you should not use mainwin_quit_cb(), |
12 | + * but his way deadlock xmms, and it anyhow just calls ctrlsocket stuff with |
13 | + * with CMD_QUIT, which anyhow calls mainwin_quit_cb() in turn. This is not |
14 | + * entirely clean, but works. |
15 | + * <azarah@gentoo.org> (19 Jan 2003) |
16 | + xmms_remote_quit(ctrlsocket_get_session_id()); */ |
17 | + mainwin_quit_cb(); |
18 | +} |
19 | + |
20 | static gboolean pposition_configure(GtkWidget *w, GdkEventConfigure *event, gpointer data) |
21 | { |
22 | gint x,y; |
23 | @@ -3521,6 +3533,8 @@ |
24 | #endif |
25 | |
26 | signal(SIGPIPE, SIG_IGN); /* for controlsocket.c */ |
27 | + signal(SIGTERM, sigterm_handler); |
28 | + signal(SIGINT, sigterm_handler); |
29 | signal(SIGSEGV, segfault_handler); |
30 | g_thread_init(NULL); |
31 | gtk_set_locale(); |