source: TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/set_father_signals.c @ 1431

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/set_father_signals.c
Revision 1431, 3.6 KB checked in by spascoe, 14 years ago (diff)

bbftpd.h should be the first #include so that glibc headers pick up
any configuration flags.

Line 
1/*
2 * bbftpd/set_father_signals.c
3 * Copyright (C) 1999, 2000, 2001, 2002 IN2P3, CNRS
4 * bbftp@in2p3.fr
5 * http://doc.in2p3.fr/bbftp
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 */ 
21
22/****************************************************************************
23
24 
25 
26 set_father_signals.c v 0.0.0  1999/11/24
27                      v 1.9.4  2000/10/16   - Supress %m
28                      v 2.0.1  2001/04/23   - Correct indentation
29 
30*****************************************************************************/
31#include <bbftpd.h>
32
33#include <errno.h>
34#include <signal.h>
35#include <bbftpd_private_log.h>
36
37int set_father_signals() {
38    struct    sigaction    sga ;
39
40    sga.sa_handler= SIG_IGN ;
41    sigemptyset(&(sga.sa_mask));
42    sga.sa_flags = 0   ;
43    if ( sigaction(SIGABRT,&sga,0) < 0 ) {
44        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGABRT : %s",strerror(errno)) ;
45        return(-1) ;
46    }
47    if ( sigaction(SIGALRM,&sga,0) < 0 ) {
48        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGALRM : %s",strerror(errno)) ;
49        return(-1) ;
50    }
51    if ( sigaction(SIGHUP,&sga,0) < 0 ) {
52        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGHUP : %s",strerror(errno)) ;
53        return(-1) ;
54    }
55    if ( sigaction(SIGINT,&sga,0) < 0 ) {
56        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGINT : %s",strerror(errno)) ;
57        return(-1) ;
58    }
59    if ( sigaction(SIGPIPE,&sga,0) < 0 ) {
60        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGPIPE : %s",strerror(errno)) ;
61        return(-1) ;
62    }
63    if ( sigaction(SIGQUIT,&sga,0) < 0 ) {
64        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGQUIT : %s",strerror(errno)) ;
65        return(-1) ;
66    }
67    if ( sigaction(SIGTERM,&sga,0) < 0 ) {
68        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGTERM : %s",strerror(errno)) ;
69        return(-1) ;
70    }
71    if ( sigaction(SIGUSR1,&sga,0) < 0 ) {
72        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGUSR1 : %s",strerror(errno)) ;
73        return(-1) ;
74    }
75    if ( sigaction(SIGUSR2,&sga,0) < 0 ) {
76        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGUSR2 : %s",strerror(errno)) ;
77        return(-1) ;
78    }
79    if ( sigaction(SIGCHLD,&sga,0) < 0 ) {
80        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGCHLD : %s",strerror(errno)) ;
81        return(-1) ;
82    }
83    if ( sigaction(SIGTSTP,&sga,0) < 0 ) {
84        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGTSTP : %s",strerror(errno)) ;
85        return(-1) ;
86    }
87    if ( sigaction(SIGPOLL,&sga,0) < 0 ) {
88        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGPOLL : %s",strerror(errno)) ;
89        return(-1) ;
90    }
91    if ( sigaction(SIGPROF,&sga,0) < 0 ) {
92        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGPROF : %s",strerror(errno)) ;
93        return(-1) ;
94    }
95    if ( sigaction(SIGURG,&sga,0) < 0 ) {
96        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGURG : %s",strerror(errno)) ;
97        return(-1) ;
98    }
99    if ( sigaction(SIGVTALRM,&sga,0) < 0 ) {
100        bbftpd_log(BBFTPD_ERR,"Error sigaction SIGVTALRM : %s",strerror(errno)) ;
101        return(-1) ;
102    }
103    return 0 ;
104}
Note: See TracBrowser for help on using the repository browser.