1 /* Copyright 1996,1997,2001,2002,2007,2009 Alain Knaff.
2 * This file is part of mtools.
4 * Mtools is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Mtools is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Mtools. If not, see <http://www.gnu.org/licenses/>.
18 #include "sysincludes.h"
25 static void signal_handler(int dummy)
29 signal(SIGHUP, SIG_IGN);
30 signal(SIGINT, SIG_IGN);
31 signal(SIGTERM, SIG_IGN);
32 signal(SIGQUIT, SIG_IGN);
37 int do_gotsignal(char *f, int n)
40 fprintf(stderr, "file=%s line=%d\n", f, n);
45 void setup_signal(void)
49 signal(SIGHUP, signal_handler);
52 signal(SIGINT, signal_handler);
55 signal(SIGTERM, signal_handler);
58 signal(SIGQUIT, signal_handler);