#include <signal.h>
#include <string.h>
#include <sys/types.h>
-#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
-#endif
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#else /* !HAVE_FCNTL_H */
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif /* HAVE_SYS_FCNTL_H */
-#endif /* !HAVE_FCNTL_H */
#include <sys/stat.h> /* get umask(2) prototyped */
#include <unistd.h>
#include "fetchmail.h"
#include "tunable.h"
-static RETSIGTYPE
+static void
sigchld_handler (int sig)
/* process SIGCHLD to obtain the exit code of the terminating process */
{
-#if defined(HAVE_WAITPID) /* the POSIX way */
int status;
while (waitpid(-1, &status, WNOHANG) > 0)
continue; /* swallow 'em up. */
-#elif defined(HAVE_WAIT3) /* the BSD way */
- pid_t pid;
-#if defined(HAVE_UNION_WAIT) && !defined(__FreeBSD__)
- union wait status;
-#else
- int status;
-#endif
-
- while ((pid = wait3(&status, WNOHANG, 0)) > 0)
- continue; /* swallow 'em up. */
-#else /* Zooks! Nothing to do but wait(), and hope we don't block... */
- int status;
-
- wait(&status);
-#endif
lastsig = SIGCHLD;
(void)sig;
}
-RETSIGTYPE null_signal_handler(int sig) { (void)sig; }
+void null_signal_handler(int sig) { (void)sig; }
SIGHANDLERTYPE set_signal_handler(int sig, SIGHANDLERTYPE handler)
/*