mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Merged most of David Shaw's changes in 1.3 since 2003-06-03.
This commit is contained in:
parent
47959a306e
commit
4c66e94ff9
45 changed files with 1489 additions and 509 deletions
27
g10/signal.c
27
g10/signal.c
|
@ -1,5 +1,5 @@
|
|||
/* signal.c - signal handling
|
||||
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
|
@ -42,7 +42,7 @@ static void
|
|||
init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign )
|
||||
{
|
||||
#ifndef HAVE_DOSISH_SYSTEM
|
||||
#ifdef HAVE_SIGACTION
|
||||
#if defined(HAVE_SIGACTION) && defined(HAVE_STRUCT_SIGACTION)
|
||||
struct sigaction oact, nact;
|
||||
|
||||
if (check_ign) {
|
||||
|
@ -132,7 +132,7 @@ void
|
|||
pause_on_sigusr( int which )
|
||||
{
|
||||
#ifndef HAVE_DOSISH_SYSTEM
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
#if defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSET_T)
|
||||
sigset_t mask, oldmask;
|
||||
|
||||
assert( which == 1 );
|
||||
|
@ -150,8 +150,8 @@ pause_on_sigusr( int which )
|
|||
while (!caught_sigusr1)
|
||||
sigpause(SIGUSR1);
|
||||
caught_sigusr1 = 0;
|
||||
sigrelse(SIGUSR1); ????
|
||||
#endif /*!HAVE_SIGPROCMASK*/
|
||||
sigrelse(SIGUSR1);
|
||||
#endif /*!HAVE_SIGPROCMASK && HAVE_SISET_T*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ do_block( int block )
|
|||
{
|
||||
#ifndef HAVE_DOSISH_SYSTEM
|
||||
static int is_blocked;
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
#if defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSET_T)
|
||||
static sigset_t oldmask;
|
||||
|
||||
if( block ) {
|
||||
|
@ -180,13 +180,22 @@ do_block( int block )
|
|||
is_blocked = 0;
|
||||
}
|
||||
#else /*!HAVE_SIGPROCMASK*/
|
||||
static void (*disposition[MAXSIG])();
|
||||
|
||||
#if defined(NSIG)
|
||||
# define SIGSMAX (NSIG)
|
||||
#elif defined(MAXSIG)
|
||||
# define SIGSMAX (MAXSIG+1)
|
||||
#else
|
||||
# error "define SIGSMAX to the number of signals on your platform plus one"
|
||||
#endif
|
||||
|
||||
static void (*disposition[SIGSMAX])(int);
|
||||
int sig;
|
||||
|
||||
if( block ) {
|
||||
if( is_blocked )
|
||||
log_bug("signals are already blocked\n");
|
||||
for (sig=1; sig < MAXSIG; sig++) {
|
||||
for (sig=1; sig < SIGSMAX; sig++) {
|
||||
disposition[sig] = sigset (sig, SIG_HOLD);
|
||||
}
|
||||
is_blocked = 1;
|
||||
|
@ -194,7 +203,7 @@ do_block( int block )
|
|||
else {
|
||||
if( !is_blocked )
|
||||
log_bug("signals are not blocked\n");
|
||||
for (sig=1; sig < MAXSIG; sig++) {
|
||||
for (sig=1; sig < SIGSMAX; sig++) {
|
||||
sigset (sig, disposition[sig]);
|
||||
}
|
||||
is_blocked = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue