lib-signals.c revision 00c032607ddc0603e40ff5cc2e03373df904a4a2
/* Copyright (c) 2001-2003 Timo Sirainen */
#include "lib.h"
#include "lib-signals.h"
#include <stdio.h>
#include <signal.h>
int lib_signal_kill;
unsigned int lib_signal_hup_count;
static void (*quit_handler) (int);
{
#ifndef HAVE_SIGACTION
/* some systems may have changed the signal handler to default one */
#endif
}
{
/* if we get killed after this, just die instead of coming back here. */
}
void lib_init_signals(void (*sig_quit_handler) (int))
{
#ifdef HAVE_SIGACTION
#endif
lib_signal_kill = 0;
lib_signal_hup_count = 0;
/* signal() behaviour is a bit inconsistent between systems
after the signal handler has been called. If the signal
isn't ignored, or your handler doesn't kill the program,
sigaction() should be used. */
#ifdef HAVE_SIGACTION
i_fatal("sigemptyset(): %m");
i_fatal("sigaction(): %m");
}
#else
#endif
/* these signals should be called only once, so it's safe to use
signal() */
}