ext/iodine/fio.c
/* handles the SIGUSR1, SIGINT and SIGTERM signals. */
handles the SIGUSR1, SIGINT and SIGTERM signals.
handles the SIGUSR1 SIGINT and SIGTERM signals .
static void sig_int_handler(int sig) {
  struct sigaction *old = NULL;
  switch (sig) {
#if !FIO_DISABLE_HOT_RESTART
  case SIGUSR1:
    fio_signal_children_flag = 1;
    old = &fio_old_sig_usr1;
    break;
#endif
  case SIGINT:
    if (!old)
      old = &fio_old_sig_int;
  case SIGTERM:
    if (!old)
      old = &fio_old_sig_term;
    fio_stop();
    break;
  case SIGPIPE:
    if (!old)
      old = &fio_old_sig_pipe;
  default:
    break;
  }
  if (old && old->sa_handler != SIG_IGN && old->sa_handler != SIG_DFL)
    old->sa_handler(sig);
}
static void sig_int_handler ( int sig ) { struct sigaction * old = NULL ; switch ( sig ) { #if ! FIO_DISABLE_HOT_RESTART case SIGUSR1 : fio_signal_children_flag = 1 ; old = & fio_old_sig_usr1 ; break ; #endif case SIGINT : if ( ! old ) old = & fio_old_sig_int ; case SIGTERM : if ( ! old ) old = & fio_old_sig_term ; fio_stop ( ) ; break ; case SIGPIPE : if ( ! old ) old = & fio_old_sig_pipe ; default : break ; } if ( old && old -> sa_handler != SIG_IGN && old -> sa_handler != SIG_DFL ) old -> sa_handler ( sig ) ; }
handles the SIGUSR1, SIGINT and SIGTERM signals.
handles the SIGUSR1 SIGINT and SIGTERM signals .
/* fallthrough */ /* fallthrough */ /* fallthrough */ /* propagate signale handling to previous existing handler (if any) */