Move the code to ignore SIGPIPE from the DSI sesssion setup stage
to the main signal handling code in main() and avoid the use
of deprecated signal() function and use sigaction.
afp_exit(EXITERR_SYS);
}
#endif
+
+ sv.sa_handler = SIG_IGN;
+ sigemptyset( &sv.sa_mask );
+ if (sigaction(SIGPIPE, &sv, NULL ) < 0 ) {
+ LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
+ afp_exit(EXITERR_SYS);
+ }
sv.sa_handler = afp_goaway; /* handler for all sigs */
/* set up the tickle timer */
dsi->timer.it_interval.tv_sec = dsi->timer.it_value.tv_sec = tickleval;
dsi->timer.it_interval.tv_usec = dsi->timer.it_value.tv_usec = 0;
- signal(SIGPIPE, SIG_IGN); /* we catch these ourselves */
dsi_opensession(dsi);
*childp = NULL;
return 0;