- /* we want these two to interrupt system calls */
- siginterrupt(SIGALRM, 1);
- siginterrupt(SIGCHLD, 1);
+ /* set signal handlers */
+ act.sa_handler = sig_handler;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGINT, &act, NULL);
+ sigaction(SIGTERM, &act, NULL);
+ sigaction(SIGALRM, &act, NULL);
+ sigaction(SIGCHLD, &act, NULL);