Exemplo n.º 1
0
static void sig_handler_main_thread(void *data) {
  int sig = GPOINTER_TO_INT(data);

  owl_function_debugmsg("Got signal %d", sig);
  if (sig == SIGWINCH) {
    owl_function_resize();
  } else if (sig == SIGTERM || sig == SIGHUP) {
    owl_function_quit();
  } else if (sig == SIGINT && owl_global_take_interrupt(&g)) {
    owl_input in;
    in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR];
    owl_process_input_char(in);
  }
}
Exemplo n.º 2
0
Arquivo: owl.c Projeto: dxiao/barnowl
void sig_handler(int sig, siginfo_t *si, void *data)
{
  if (sig==SIGWINCH) {
    /* we can't inturrupt a malloc here, so it just sets a flag
     * schedulding a resize for later
     */
    owl_function_resize();
  } else if (sig==SIGPIPE || sig==SIGCHLD) {
    /* Set a flag and some info that we got the sigpipe
     * so we can record that we got it and why... */
    owl_global_set_errsignal(&g, sig, si);
  } else if (sig==SIGTERM || sig==SIGHUP) {
    owl_function_quit();
  }
}