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 -------------
char *m_mailpath (char *);
char *m_name (int);
int m_putenv (char *, char *);
-char *m_scratch (char *, char *);
-char *m_tmpfil (char *);
char *m_mktemp(const char *, int *, FILE **);
char *m_mktemp2(const char *, const char *, int *, FILE **);
void m_unknown(FILE *);
fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c \
fmt_scan.c lock_file.c m_atoi.c m_backup.c \
m_convert.c m_draft.c m_getfld.c m_gmprot.c \
- m_maildir.c m_name.c m_scratch.c m_tmpfil.c \
+ m_maildir.c m_name.c \
makedir.c mts.c norm_charmap.c \
path.c peekc.c pidwait.c pidstatus.c \
print_help.c print_sw.c print_version.c push.c \
curlock = li->curlock;
tmplock = li->tmplock;
-#ifdef HAVE_MKSTEMP
if ((fd = mkstemp(tmplock)) == -1)
return -1;
-#else
- if (mktemp(tmplock) == NULL)
- return -1;
- if (unlink(tmplock) == -1 && errno != ENOENT)
- return -1;
- /* create the temporary lock file */
- if ((fd = creat(tmplock, 0600)) == -1)
- return -1;
-#endif
#if 0
/* write our process id into lock file */
*/
#include <sigmsg.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
#ifndef WTERMSIG
# define WTERMSIG(s) ((int)((s) & 0x7F))
#endif
#include <errno.h>
#include <signal.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
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
}
#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 },
# endif
#endif
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
extern int debugsw;
extern int verbosw;
# endif
#endif
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
extern int debugsw;
extern pid_t xpid; /* mhshowsbr.c or mhbuildsbr.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/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/mime.h>
#include <h/mhparse.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
extern int ebcdicsw;
#include <h/mhparse.h>
#include <h/utils.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
extern int debugsw;
#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/mhparse.h>
#include <h/utils.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
/*
* Just use sigjmp/longjmp on older machines that
* don't have sigsetjmp/siglongjmp.
{
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
* the viewer (e.g., lynx) are going to be accessible */
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 },
char tmpfil[BUFSIZ];
struct stat st;
-#ifdef HAVE_MKSTEMP
fd = mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil)));
-#else
- unlink (mktemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil))));
- if ((fd = open (tmpfil, O_RDWR | O_CREAT | O_TRUNC, 0600)) == NOTOK)
- return header_fd ();
-#endif
unlink (tmpfil);
if ((child_id = vfork()) == NOTOK) {
out = stdout;
}
else {
-#ifdef HAVE_MKSTEMP
if ((out = fdopen( mkstemp (tmpfil), "w" )) == NULL )
adios (tmpfil, "unable to create");
-#else
- mktemp (tmpfil);
- if ((out = fopen (tmpfil, "w")) == NULL)
- adios (tmpfil, "unable to create");
- chmod (tmpfil, 0600);
-#endif
}
hdrtab = (msgstate == normal) ? NHeaders : RHeaders;
char *vec[6];
FILE * in, *out;
-#ifdef HAVE_MKSTEMP
fd = mkstemp(bccfil);
if (fd == -1 || (out = fdopen(fd, "w")) == NULL)
adios (bccfil, "unable to create");
-#else
- mktemp (bccfil);
- if ((out = fopen (bccfil, "w")) == NULL)
- adios (bccfil, "unable to create");
-#endif
chmod (bccfil, 0600);
fprintf (out, "Date: %s\n", dtimenow (0));
#include <h/mime.h>
#include <h/mhparse.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
static struct swit switches[] = {
#define TOSW 0
{ "to mailpath", 0 },