1 /* @(#) $Id: sig_op.c,v 1.8 2009/06/24 18:53:09 dcid Exp $ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 3) as published by the FSF - Free Software
13 /* Functions to handle signal manipulation
26 #include "error_messages/error_messages.h"
32 merror(SIGNAL_RECV, pidfile);
40 /* To avoid client-server communication problems */
46 void StartSIG(char *process_name)
48 /* Signal Manipulation
50 pidfile = process_name;
52 signal(SIGHUP, SIG_IGN);
53 signal(SIGINT, HandleSIG);
54 signal(SIGQUIT, HandleSIG);
55 signal(SIGTERM, HandleSIG);
56 signal(SIGALRM, HandleSIG);
57 signal(SIGPIPE, HandleSIGPIPE);
60 void StartSIG2(char *process_name, void (*func)(int))
62 pidfile = process_name;
64 signal(SIGHUP, SIG_IGN);
66 signal(SIGQUIT, func);
67 signal(SIGTERM, func);
68 signal(SIGALRM, func);
69 signal(SIGPIPE, HandleSIGPIPE);