bool dofork = false;
char *pidfilename = NULL;
FILE *pidfile = NULL;
+ struct sigaction children_sigaction;
#ifdef HAVE_VERBOSE_TERMINATE_HANDLER
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
if (stat(sock,&junk) == 0) unlink(sock);
}
+ /* We don't care about any of our children, so ignore all of them */
+ /* Set up sigaction to avoid having to reap children */
+ memset(&children_sigaction, 0, sizeof children_sigaction);
+ children_sigaction.sa_flags = SA_NOCLDWAIT;
+ sigaction(SIG_CHLD,&children_sigaction,0);
+
+
(void) smfi_setconn(sock);
if (smfi_register(smfilter) == MI_FAILURE) {
fprintf(stderr, "smfi_register failed\n");
FILE *iop;
int pdes[2];
int save_errno;
+ pid_t pid;
+
if ((*type != 'r' && *type != 'w') || type[1])
{
errno = EINVAL;
}
if (pipe(pdes) < 0)
return (NULL);
- switch (fork()) {
+
+ pid = fork();
+ switch (pid) {
case -1: /* Error. */
save_errno = errno;