diff options
Diffstat (limited to 'g10/signal.c')
-rw-r--r-- | g10/signal.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/g10/signal.c b/g10/signal.c index 140259a19..1028ab705 100644 --- a/g10/signal.c +++ b/g10/signal.c @@ -41,8 +41,8 @@ static volatile int caught_sigusr1 = 0; static void init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign ) { - #ifndef HAVE_DOSISH_SYSTEM - #ifdef HAVE_SIGACTION +#ifndef HAVE_DOSISH_SYSTEM +#ifdef HAVE_SIGACTION struct sigaction oact, nact; if (check_ign) { @@ -56,7 +56,7 @@ init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign ) sigemptyset (&nact.sa_mask); nact.sa_flags = 0; sigaction ( sig, &nact, NULL); - #else +#else RETSIGTYPE (*ohandler)(int); ohandler = signal (sig, handler); @@ -64,18 +64,18 @@ init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign ) /* Change it back if it was already set to IGN */ signal (sig, SIG_IGN); } - #endif - #endif /*!HAVE_DOSISH_SYSTEM*/ +#endif +#endif /*!HAVE_DOSISH_SYSTEM*/ } static const char * get_signal_name( int signum ) { - #if defined(SYS_SIGLIST_DECLARED) && defined(NSIG) +#if defined(SYS_SIGLIST_DECLARED) && defined(NSIG) return (signum >= 0 && signum < NSIG) ? sys_siglist[signum] : "?"; - #else +#else return "some signal"; - #endif +#endif } @@ -116,7 +116,7 @@ got_usr_signal( int sig ) void init_signals() { - #ifndef HAVE_DOSISH_SYSTEM +#ifndef HAVE_DOSISH_SYSTEM init_one_signal (SIGINT, got_fatal_signal, 1 ); init_one_signal (SIGHUP, got_fatal_signal, 1 ); init_one_signal (SIGTERM, got_fatal_signal, 1 ); @@ -124,15 +124,15 @@ init_signals() init_one_signal (SIGSEGV, got_fatal_signal, 1 ); init_one_signal (SIGUSR1, got_usr_signal, 0 ); init_one_signal (SIGPIPE, SIG_IGN, 0 ); - #endif +#endif } void pause_on_sigusr( int which ) { - #ifndef HAVE_DOSISH_SYSTEM - #ifdef HAVE_SIGPROCMASK +#ifndef HAVE_DOSISH_SYSTEM +#ifdef HAVE_SIGPROCMASK sigset_t mask, oldmask; assert( which == 1 ); @@ -144,24 +144,24 @@ pause_on_sigusr( int which ) sigsuspend( &oldmask ); caught_sigusr1 = 0; sigprocmask( SIG_UNBLOCK, &mask, NULL ); - #else +#else assert (which == 1); sighold (SIGUSR1); while (!caught_sigusr1) sigpause(SIGUSR1); caught_sigusr1 = 0; sigrelse(SIGUSR1); ???? - #endif /*!HAVE_SIGPROCMASK*/ - #endif +#endif /*!HAVE_SIGPROCMASK*/ +#endif } static void do_block( int block ) { - #ifndef HAVE_DOSISH_SYSTEM +#ifndef HAVE_DOSISH_SYSTEM static int is_blocked; - #ifdef HAVE_SIGPROCMASK +#ifdef HAVE_SIGPROCMASK static sigset_t oldmask; if( block ) { @@ -179,7 +179,7 @@ do_block( int block ) sigprocmask( SIG_SETMASK, &oldmask, NULL ); is_blocked = 0; } - #else /*!HAVE_SIGPROCMASK*/ +#else /*!HAVE_SIGPROCMASK*/ static void (*disposition[MAXSIG])(); int sig; @@ -199,8 +199,8 @@ do_block( int block ) } is_blocked = 0; } - #endif /*!HAVE_SIGPROCMASK*/ - #endif /*HAVE_DOSISH_SYSTEM*/ +#endif /*!HAVE_SIGPROCMASK*/ +#endif /*HAVE_DOSISH_SYSTEM*/ } |