#include <sigevent.h>
#include <log.h>
#include <memory.h>
+#include <lib_errors.h>
#ifdef SA_SIGINFO
#ifdef HAVE_UCONTEXT_H
sigdelset(&newmask, SIGKILL);
if ((sigprocmask(SIG_BLOCK, &newmask, &oldmask)) < 0) {
- zlog_err("quagga_signal_timer: couldnt block signals!");
+ flog_err_sys(EC_LIB_SYSTEM_CALL,
+ "quagga_signal_timer: couldnt block signals!");
return -1;
}
#endif /* SIGEVENT_BLOCK_SIGNALS */
int quagga_signal_timer(struct thread *t)
{
struct quagga_sigevent_master_t *sigm;
- struct quagga_signal_t *sig;
- int i;
sigm = THREAD_ARG(t);
sigm->t = NULL;
,
siginfo_t *siginfo, void *context
#endif
-)
+ )
{
zlog_signal(signo, "exiting..."
#ifdef SA_SIGINFO
,
siginfo, program_counter(context)
#endif
- );
+ );
_exit(128 + signo);
}
,
siginfo_t *siginfo, void *context
#endif
-)
+ )
{
/* make sure we don't hang in here. default for SIGALRM is terminate.
* - if we're in backtrace for more than a second, abort. */
,
siginfo, program_counter(context)
#endif
- );
+ );
/* dump memory stats on core */
- log_memstats_stderr("core_handler");
+ log_memstats(stderr, "core_handler");
abort();
}
};
static const struct {
const int *sigs;
- u_int nsigs;
+ unsigned int nsigs;
void (*handler)(int signo
#ifdef SA_SIGINFO
,
siginfo_t *info, void *context
#endif
- );
+ );
} sigmap[] = {
{core_signals, array_size(core_signals), core_handler},
{exit_signals, array_size(exit_signals), exit_handler},
{ignore_signals, array_size(ignore_signals), NULL},
};
- u_int i;
+ unsigned int i;
for (i = 0; i < array_size(sigmap); i++) {
- u_int j;
+ unsigned int j;
for (j = 0; j < sigmap[i].nsigs; j++) {
struct sigaction oact;
}
if (sigaction(sigmap[i].sigs[j], &act, NULL)
< 0)
- zlog_warn(
+ flog_err(
+ EC_LIB_SYSTEM_CALL,
"Unable to set signal handler for signal %d: %s",
sigmap[i].sigs[j],
safe_strerror(errno));