1 /* @(#) $Id: ./src/shared/sig_op.c, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2009 Trend Micro Inc.
7 * This program is a free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General Public
9 * License (version 2) as published by the FSF - Free Software
14 /* Functions to handle signal manipulation
27 #include "error_messages/error_messages.h"
33 merror(SIGNAL_RECV, pidfile);
41 /* To avoid client-server communication problems */
47 void StartSIG(char *process_name)
49 /* Signal Manipulation
51 pidfile = process_name;
53 signal(SIGHUP, SIG_IGN);
54 signal(SIGINT, HandleSIG);
55 signal(SIGQUIT, HandleSIG);
56 signal(SIGTERM, HandleSIG);
57 signal(SIGALRM, HandleSIG);
58 signal(SIGPIPE, HandleSIGPIPE);
61 void StartSIG2(char *process_name, void (*func)(int))
63 pidfile = process_name;
65 signal(SIGHUP, SIG_IGN);
67 signal(SIGQUIT, func);
68 signal(SIGTERM, func);
69 signal(SIGALRM, func);
70 signal(SIGPIPE, HandleSIGPIPE);