summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a99d213)
This is unnecessary since the curses library generates a KEY_RESIZE
event on SIGWINCH anyway. Hence window change events can be handled
as well in the normal input processing function. This allows to remove
the SIGWINCH part of the signal handling code.
Another advantage of handling SIGWINCH in the same way as normal
input events is that it is easier to propagate the event. This will
turn out to be useful for the upcoming gui menu changes.
case SIGTERM:
die(EXIT_FAILURE, "only the good die young (caught SIGTERM)\n");
return 1;
case SIGTERM:
die(EXIT_FAILURE, "only the good die young (caught SIGTERM)\n");
return 1;
- case SIGWINCH:
- if (curses_active()) {
- shutdown_curses();
- init_curses();
- redraw_bot_win();
- }
- return 1;
case SIGINT:
PARA_WARNING_LOG("caught SIGINT, reset\n");
/* Nothing to do. SIGINT killed our child which gets noticed
case SIGINT:
PARA_WARNING_LOG("caught SIGINT, reset\n");
/* Nothing to do. SIGINT killed our child which gets noticed
in.needs_update = sep.needs_update = false;
}
ret = wgetch(top.win);
in.needs_update = sep.needs_update = false;
}
ret = wgetch(top.win);
- if (ret == ERR || ret == KEY_RESIZE)
- if (exs == EXEC_IDLE) {
- handle_command(ret);
+ if (ret == KEY_RESIZE) {
+ if (curses_active()) {
+ shutdown_curses();
+ init_curses();
+ redraw_bot_win();
+ }
+ if (exs == EXEC_IDLE)
+ handle_command(ret);
+ else if (exec_pid > 0)
kill(exec_pid, SIGTERM);
return 0;
}
kill(exec_pid, SIGTERM);
return 0;
}
para_install_sighandler(SIGINT);
para_install_sighandler(SIGTERM);
para_install_sighandler(SIGCHLD);
para_install_sighandler(SIGINT);
para_install_sighandler(SIGTERM);
para_install_sighandler(SIGCHLD);
- para_install_sighandler(SIGWINCH);
para_install_sighandler(SIGUSR1);
register_task(&sched, &exec_task.task);
para_install_sighandler(SIGUSR1);
register_task(&sched, &exec_task.task);