#include <signal.h> #include <stdlib.h> #include "totoro.h" static jmp_buf env; void cat_bus(int sig) { goto_may(); longjmp(env, 1); } int main(void) { if (signal(SIGLOST, cat_bus) == SIG_ERR) { exit(1); } if (setjmp(env) == 0) { while (1) { search_may(); } } else { goto_hospital(); } return 0; }
「バルス!」と叫んで最初から組み直してください。