1
/* This software is Copyright 1997 by Stan Barber.
3
* Permission is hereby granted to copy, reproduce, redistribute or otherwise
4
* use this software as long as: there is no monetary profit gained
5
* specifically from the use or reproduction of this software, it is not
6
* sold, rented, traded or otherwise marketed, and this copyright notice is
7
* included prominently in any copy made.
9
* The author make no claims as to the fitness or correctness of this software
10
* for any use whatsoever, and it is provided as is. Any use of this software
11
* is at the user's own risk.
14
static char * rcsid = "$Id: sigfix.c,v 1.1 1999/06/30 17:19:37 he Exp $";
19
* delay_signaling(), enable_signaling - delay signal delivery for a while
21
* Original Author: Wietse Venema with small changes by Dave Kinchlea and
26
* Some folks (notably those who do Linux hacking) say this fix is needed.
27
* Others (notably the FreeBSD and BSDI folks) say if isn't.
28
* I am making it possible to include of exclude it.
29
* Just define NEED_SIGFIX and you get it.
32
#include <sys/types.h>
33
#include <sys/signal.h>
36
static sigset_t saved_sigmask;
37
sigset_t block_sigmask; /* used in ftpd.c */
41
/* enable_signaling - deliver delayed signals and disable signal delay */
44
int enable_signaling(void)
46
int enable_signaling()
52
if (sigprocmask(SIG_SETMASK, &saved_sigmask, (sigset_t *) 0) < 0) {
53
syslog(LOG_ERR, "sigprocmask: %m");
61
/* delay_signaling - save signal mask and block all signals */
63
int delay_signaling(void)
71
if (sigprocmask(SIG_BLOCK, &block_sigmask, &saved_sigmask) < 0) {
72
syslog(LOG_ERR, "sigprocmask: %m");