4 |
#include <errno.h> |
#include <errno.h> |
5 |
#include <string.h> |
#include <string.h> |
6 |
#include <stdarg.h> |
#include <stdarg.h> |
7 |
|
#include <signal.h> |
8 |
#include <limits.h> |
#include <limits.h> |
9 |
#include <sys/types.h> |
#include <sys/types.h> |
10 |
#include <sys/stat.h> |
#include <sys/stat.h> |
88 |
} |
} |
89 |
|
|
90 |
|
|
91 |
|
/* |
92 |
|
* Catch signals that cause program's termination. |
93 |
|
*/ |
94 |
|
void catch_signals(void) |
95 |
|
{ |
96 |
|
signal(SIGINT, signal_handler); |
97 |
|
signal(SIGQUIT, signal_handler); |
98 |
|
signal(SIGTERM, signal_handler); |
99 |
|
} |
100 |
|
|
101 |
|
|
102 |
|
/* |
103 |
|
* Signal handler for signals that cause termination of program. |
104 |
|
*/ |
105 |
|
void signal_handler(int sig) |
106 |
|
{ |
107 |
|
fatal(ERROR_SIGNAL, "imapfilter: killed by signal %d\n", sig); |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
/* |
/* |
112 |
* Open the file for saving of logging information. |
* Open the file for saving of logging information. |