#include "bbs.h"

void sighandler(int sig)
{
  signumber = sig;
  switch (sig) {
  case SIGTERM:
  case SIGHUP:
    if (canjump_sigenv)  siglongjmp(sigenv,1);
    break;
  case SIGALRM:
    if (canjump_sigalrm)  siglongjmp(sigalrmenv,1);
    break;
  case SIGUSR1:
    if (canjump_sigusr1)  siglongjmp(sigusr1env,1);
    break;
  case SIGUSR2:
    if (canjump_sigusr2)  siglongjmp(sigusr2env,1);
    break;
  }
  bgerror("sighandler","got signal %d but cannot jump",sig);
}


void sigtalkaccepthandler(int sig)
{
  if (canjump_talkaccept)  siglongjmp(talkacceptenv,1);
  bgerror("sigtalkaccepthandler","got signal %d but cannot jump",sig);
}
