Signed-off-by: W. Trevor King <wking@tremily.us>
# Checks for header files.
AC_CHECK_HEADERS_ONCE([locale.h signal.h sys/select.h sys/uio.h argp.h
- unistd.h sys/time.h sys/types.h sys/stat.h])
+ unistd.h wait.h sys/time.h sys/types.h sys/stat.h])
# Type checks.
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
+#ifdef HAVE_WAIT_H
+# include <wait.h>
+#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
{
gpg_error_t err;
pid_t pid;
+ int status;
assuan_fd_t sock = ASSUAN_INVALID_FD;
assuan_fd_t filedes[2];
struct server server;
break; /* child; continue setting up server */
}
/* parent; continue listening for other connections */
+#ifdef HAVE_WAIT_H
+ /* reap any defunct children */
+ do {
+ pid = waitpid(-1, &status, WNOHANG);
+ if (pid < 0) {
+ err = gpg_error_from_syserror ();
+ log_error (0, err, "waitpid() failed");
+ }
+ } while (pid);
+#endif
}
#ifdef HAVE_SIGNAL_H