2 * inoclam - Inotify+ClamAV virus scanner
3 * Copyright (C) 2007, 2008, 2009 Vermont Department of Taxes
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program 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 this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <libdaemon/dlog.h>
25 * Global variable used to determine if the program should halt. Will it ever halt? Only Alan Turing knows.
26 * @see handle_signal()
31 * Signal handler for SIGKILL
32 * @param sig signal to handle.
34 void handle_sigkill(int sig
)
38 daemon_log(LOG_INFO
, "SIGKILL Caught ; preparing to exit");
43 * Signal handler for SIGQUIT
44 * @param sig signal to handle.
46 void handle_sigquit(int sig
)
50 daemon_log(LOG_INFO
, "SIGQUIT Caught ; preparing to exit");
55 * Signal handler for SIGINT
56 * @param sig signal to handle.
58 void handle_sigint(int sig
)
62 daemon_log(LOG_INFO
, "SIGINT Caught ; preparing to exit");
67 * installs signal handlers (mostly SIG_IGN)
69 void install_signal_handlers()
74 for (i
= 0; i
< 32; i
++) {
75 if (i
!= SIGCHLD
&& i
!= SIGQUIT
&& i
!= SIGINT
&& i
!= SIGKILL
) {
80 signal(SIGKILL
, handle_sigkill
);
81 signal(SIGQUIT
, handle_sigquit
);
82 signal(SIGINT
, handle_sigint
);