source: roaraudio/roard/signals.c @ 4708:c9d40761088a

Last change on this file since 4708:c9d40761088a was 4708:c9d40761088a, checked in by phi, 13 years ago

updated copyright statements

File size: 1.6 KB
Line 
1//signals.c:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2011
5 *
6 *  This file is part of roard a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  RoarAudio is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 *  Boston, MA 02110-1301, USA.
23 *
24 */
25
26#include "roard.h"
27
28// we should add signal handling on micro controllsers here.
29
30#if !defined(ROAR_TARGET_MICROCONTROLLER) && !defined(ROAR_TARGET_WIN32)
31
32void on_sig_int (int signum) {
33 ROAR_INFO("got SIGINT", ROAR_DBG_INFO_NOTICE);
34
35 // TODO: implement some kind of termonate/force depending on how many ^Cs we get
36 on_sig_term(signum);
37}
38
39void on_sig_term (int signum) {
40 ROAR_INFO("got SIGTERM (or called by SIGINT handler)", ROAR_DBG_INFO_NOTICE);
41
42 alive = 0;
43 clean_quit();
44}
45
46void on_sig_chld (int signum) {
47 ROAR_INFO("got SIGCHLD", ROAR_DBG_INFO_NOTICE);
48
49 wait(NULL);
50
51 signal(SIGCHLD, on_sig_chld);
52}
53
54void on_sig_usr1 (int signum) {
55 ROAR_INFO("got SIGUSR1", ROAR_DBG_INFO_NOTICE);
56
57 cleanup_listen_socket(1);
58}
59
60#endif
61
62
63//ll
Note: See TracBrowser for help on using the repository browser.