"Fossies" - the Fresh Open Source Software Archive 
Member "authforce-0.9.9/src/signal.c" (13 May 2007, 610 Bytes) of package /linux/www/old/authforce-0.9.9.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "signal.c" see the
Fossies "Dox" file reference documentation.
1 /* $Id: signal.c,v 1.4 2001/04/28 20:32:47 kapheine Exp $ */
2
3 #include <config.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <signal.h>
7 #ifdef MEMWATCH
8 #include "memwatch.h"
9 #endif /* MEMWATCH */
10 #include "extern.h"
11
12 void save_session_handler() {
13
14 if (!quiet)
15 printf("Saving session to %s\n", session_file);
16 write_session(session_file);
17
18 exit(EXIT_SUCCESS);
19 }
20
21 void install_handler() {
22
23 sigset_t sigint;
24
25 debug(3, "install_handler: signal SIGINT installing\n");
26
27 signal(SIGINT, save_session_handler);
28 sigemptyset(&sigint);
29 sigaddset(&sigint, SIGINT);
30 sigprocmask(SIG_UNBLOCK, &sigint, NULL);
31 }