- signal(SIGTERM, dumpabort); /* Slave sends SIGTERM on dumpabort() */
- signal(SIGPIPE, sigpipe);
- signal(SIGUSR1, tperror); /* Slave sends SIGUSR1 on tape errors */
- signal(SIGUSR2, proceed); /* Slave sends SIGUSR2 to next slave */
+ { struct sigaction sa;
+ memset(&sa, 0, sizeof sa);
+ sigemptyset(&sa.sa_mask);
+ sa.sa_handler = dumpabort;
+ sigaction(SIGTERM, &sa, NULL); /* Slave sends SIGTERM on dumpabort() */
+ sa.sa_handler = sigpipe;
+ sigaction(SIGPIPE, &sa, NULL);
+ sa.sa_handler = tperror;
+ sigaction(SIGUSR1, &sa, NULL); /* Slave sends SIGUSR1 on tape errors */
+ sa.sa_handler = proceed;
+ sa.sa_flags = SA_RESTART;
+ sigaction(SIGUSR2, &sa, NULL); /* Slave sends SIGUSR2 to next slave */
+ }