Merged from nmh. Thanks to Lyndon Nerenberg.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_TIME
-AC_HEADER_SYS_WAIT
AC_HEADER_STAT
AC_HEADER_TIOCGWINSZ
AC_CHECK_HEADERS(fcntl.h crypt.h termcap.h \
dnl ---------------
dnl CHECK FUNCTIONS
dnl ---------------
-AC_CHECK_FUNCS(waitpid sigaction sigprocmask sigblock sigsetmask \
+AC_CHECK_FUNCS(sigaction sigprocmask sigblock sigsetmask \
sighold sigrelse lstat tzset \
getutent nl_langinfo mbtowc wcwidth)
AC_CHECK_MEMBERS(struct utmp.ut_type,,,[#include <utmp.h>])
-AC_MSG_CHECKING(for union wait)
-AC_CACHE_VAL(nmh_cv_union_wait, [dnl
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/wait.h>]],
- [[union wait status; int pid; pid = wait (&status);
-#ifdef WEXITSTATUS
-/* Some POSIXoid systems have both the new-style macros and the old
- union wait type, and they do not work together. If union wait
- conflicts with WEXITSTATUS et al, we don't want to use it at all. */
- if (WEXITSTATUS (status) != 0) pid = -1;
-#ifdef WTERMSIG
- /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
- -- blow chunks here --
-#endif
-#endif
-#ifdef HAVE_WAITPID
- /* Make sure union wait works with waitpid. */
- pid = waitpid (-1, &status, 0);
-#endif
- ]])],
- [nmh_cv_union_wait=yes],
- [nmh_cv_union_wait=no])])
-if test "$nmh_cv_union_wait" = yes; then
- AC_DEFINE(HAVE_UNION_WAIT, 1,
- [Define to 1 if you have the \`union wait' type in <sys/wait.h>.])
-fi
-AC_MSG_RESULT($nmh_cv_union_wait)
-
CHECK_TYPE_STRUCT_DIRENT_D_TYPE()
dnl -------------
** auto-generated header
*/
#include <sigmsg.h>
-
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
+#include <sys/wait.h>
#ifndef WTERMSIG
# define WTERMSIG(s) ((int)((s) & 0x7F))
#include <h/signals.h>
#include <errno.h>
#include <signal.h>
-
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
+#include <sys/wait.h>
int
pidwait(pid_t id, int sigsok)
{
pid_t pid;
SIGNAL_HANDLER istat = NULL, qstat = NULL;
-
-#ifdef HAVE_UNION_WAIT
- union wait status;
-#else
int status;
-#endif
if (sigsok == -1) {
/* ignore a couple of signals */
qstat = SIGNAL(SIGQUIT, SIG_IGN);
}
-#ifdef HAVE_WAITPID
while ((pid = waitpid(id, &status, 0)) == -1 && errno == EINTR)
;
-#else
- while ((pid = wait(&status)) != -1 && pid != id)
- continue;
-#endif
if (sigsok == -1) {
/* reset the signal handlers */
SIGNAL(SIGQUIT, qstat);
}
-#ifdef HAVE_UNION_WAIT
- return (pid == -1 ? -1 : status.w_status);
-#else
return (pid == -1 ? -1 : status);
-#endif
}
# endif
#endif
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
# endif
#endif
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
extern int debugsw;
extern pid_t xpid; /* mhshowsbr.c or mhbuild.c */
#include <h/mhcachesbr.h>
#include <h/utils.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
#include <h/mime.h>
#include <h/mhparse.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
-
extern int ebcdicsw;
static char ebcdicsafe[0x100] = {
#include <h/mhparse.h>
#include <h/utils.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
-
extern int debugsw;
extern int endian; /* mhmisc.c */
#include <h/mhcachesbr.h>
#include <h/utils.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/utils.h>
-
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
+#include <sys/wait.h>
/*
** Just use sigjmp/longjmp on older machines that
show_single_message(CT ct, char *form)
{
sigset_t set, oset;
-
-#ifdef HAVE_UNION_WAIT
- union wait status;
-#else
int status;
-#endif
/*
** Allow user executable bit so that temporary directories created by
SIGPROCMASK(SIG_BLOCK, &set, &oset);
while (wait(&status) != NOTOK) {
-#ifdef HAVE_UNION_WAIT
- pidcheck(status.w_status);
-#else
pidcheck(status);
-#endif
continue;
}
if (serial && !nowserial) {
pid_t pid;
int kids;
-#ifdef HAVE_UNION_WAIT
- union wait status;
-#else
int status;
-#endif
kids = 0;
for (part = m->mp_parts; part; part = part->mp_next) {
}
while (kids > 0 && (pid = wait(&status)) != NOTOK) {
-#ifdef HAVE_UNION_WAIT
- pidcheck(status.w_status);
-#else
pidcheck(status);
-#endif
for (part = m->mp_parts; part; part = part->mp_next) {
p = part->mp_part;
#include <h/mhcachesbr.h>
#include <h/utils.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
static struct swit switches[] = {
#define AUTOSW 0
{ "auto", 0 },
#include <h/mhcachesbr.h>
#include <h/utils.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },