/[imapfilter]/imapfilter/log.c
ViewVC logotype

Diff of /imapfilter/log.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by lefcha, Wed Oct 17 14:07:29 2001 UTC revision 1.18 by lefcha, Fri Nov 9 18:01:29 2001 UTC
# Line 4  Line 4 
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>
# Line 87  void fatal(unsigned int errnum, const ch Line 88  void fatal(unsigned int errnum, const ch
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.

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26