changeset 2076:c291952bf462 trunk

[svn] - exit gracefully on SIGINT/SIGTERM.
author nenolod
date Mon, 11 Dec 2006 01:23:47 -0800
parents 2b93747d7b04
children e074c9ba7072
files ChangeLog audacious/main.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Dec 09 02:18:22 2006 -0800
+++ b/ChangeLog	Mon Dec 11 01:23:47 2006 -0800
@@ -1,3 +1,12 @@
+2006-12-09 10:18:22 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [3153]
+  - build fix
+  
+  trunk/libaudacious/vfs_buffer.c |    1 +
+  trunk/libaudacious/vfs_buffer.h |    2 +-
+  2 files changed, 2 insertions(+), 1 deletion(-)
+
+
 2006-12-09 10:01:53 +0000  William Pitcock <nenolod@nenolod.net>
   revision [3151]
   - move xmms_urldecode_path() back into main binary
--- a/audacious/main.c	Sat Dec 09 02:18:22 2006 -0800
+++ b/audacious/main.c	Mon Dec 11 01:23:47 2006 -0800
@@ -972,6 +972,13 @@
 #endif
 }
 
+/* Handles SIGINT/SIGTERM events gracefully. */
+static void
+sigterm_handler(gint sig)
+{
+    mainwin_quit_cb();
+}
+
 static void
 bmp_setup_logger(void)
 {
@@ -1076,6 +1083,8 @@
         bmp_setup_logger();
 
     signal(SIGPIPE, SIG_IGN);   /* for controlsocket.c */
+    signal(SIGINT,  sigterm_handler);
+    signal(SIGTERM, sigterm_handler);
 
     /* in particular environment (maybe with glibc 2.5), core file
        through signal handler doesn't contain useful back trace. */