*** 1.17	1991/08/14 18:28:19
--- Makefile	1993/03/17 11:22:29
***************
*** 46,61 ****
  # compilers in order to select the correct byte-ordering in <arpa/nameser.h>
  # and to use the right getloadavg() routine.  IT'S LIKELY THAT THE -Dvax
  # BELOW WILL BE WRONG FOR YOUR MACHINE.
! CC=	cc
  #CC=	gcc -Dvax -ansi -fpcc-struct-return -fstrength-reduce 
  DEFS=	
! CFLAGS=	-O -I. ${DEFS} 
  LDFLAGS= 
  # Choose the dbm library based on the setting in conf.h.
  # GDBM: -lndbm, SDBM: -lsdbm, HDBM: -lhash, MDBM: -lmdbm, else: -ldbm or none
! DBMLIB=	
! LIBS=	${DBMLIB}
! LIBDIR=	/usr/local/lib/mail
  
  #
  # Look for any missing routines in ../support and add them as needed to the
--- 46,62 ----
  # compilers in order to select the correct byte-ordering in <arpa/nameser.h>
  # and to use the right getloadavg() routine.  IT'S LIKELY THAT THE -Dvax
  # BELOW WILL BE WRONG FOR YOUR MACHINE.
! #CC=	cc
  #CC=	gcc -Dvax -ansi -fpcc-struct-return -fstrength-reduce 
+ CC=	gcc -Wall -Wno-comment -Wwrite-strings
  DEFS=	
! #CFLAGS=	-O -I. ${DEFS} 
  LDFLAGS= 
  # Choose the dbm library based on the setting in conf.h.
  # GDBM: -lndbm, SDBM: -lsdbm, HDBM: -lhash, MDBM: -lmdbm, else: -ldbm or none
! DBMLIB=	-ldbm
! LIBS=	${DBMLIB} -lsyslog
! LIBDIR=	/usr/lib/mail
  
  #
  # Look for any missing routines in ../support and add them as needed to the
***************
*** 127,133 ****
  #  crashes it, you have the 'pmeg' bug.  Get patch 100092-03 and install it.
  #  It's available via anon-FTP from princeton.edu in
  #  pub/sun-fixes/sunos4.1/{100092-03.tar.Z,README.100092-03}
! # CFLAGS= -Bstatic -O -I. ${DEFS} 
  #
  # Get and install Bind 4.8.3 if your libc.a || libresolv.a lack the 
  # res_search() call.
--- 128,135 ----
  #  crashes it, you have the 'pmeg' bug.  Get patch 100092-03 and install it.
  #  It's available via anon-FTP from princeton.edu in
  #  pub/sun-fixes/sunos4.1/{100092-03.tar.Z,README.100092-03}
! CFLAGS= -O2 -I. ${DEFS} 
! LDFLAGS= -static -N -s
  #
  # Get and install Bind 4.8.3 if your libc.a || libresolv.a lack the 
  # res_search() call.
***************
*** 150,160 ****
  	size sendmail; ls -l sendmail; ${WHAT} < version.o
  
  install: ${MAN}
! #	install -c -s -o root -m 4511 sendmail ${DESTDIR}/usr/lib
! 	install -c -s -o root -m 4511 sendmail ${DESTDIR}/usr/sbin
  	-mkdir ${DESTDIR}/${LIBDIR}
  	-mkdir ${DESTDIR}/${LIBDIR}/char
! #	install -c -o bin -g bin -m 644 /dev/null ${DESTDIR}/etc/sendmail.fc
  	install -c -o bin -g bin -m 666 /dev/null ${DESTDIR}/${LIBDIR}/sendmail.st
  	install -c -o bin -g bin -m 444 sendmail.hf ${DESTDIR}/${LIBDIR}/sendmail.hf
  	install -c -o bin -g bin -m 444 sendmail.0 ${DESTDIR}/usr/man/cat8
--- 152,162 ----
  	size sendmail; ls -l sendmail; ${WHAT} < version.o
  
  install: ${MAN}
! 	install -c -s -o root -m 4511 sendmail ${DESTDIR}/usr/lib
! #	install -c -s -o root -m 4511 sendmail ${DESTDIR}/usr/sbin
  	-mkdir ${DESTDIR}/${LIBDIR}
  	-mkdir ${DESTDIR}/${LIBDIR}/char
! 	install -c -o bin -g bin -m 644 /dev/null ${DESTDIR}/etc/sendmail.fc
  	install -c -o bin -g bin -m 666 /dev/null ${DESTDIR}/${LIBDIR}/sendmail.st
  	install -c -o bin -g bin -m 444 sendmail.hf ${DESTDIR}/${LIBDIR}/sendmail.hf
  	install -c -o bin -g bin -m 444 sendmail.0 ${DESTDIR}/usr/man/cat8
*** 5.21.0.24	1991/08/14 16:56:42
--- alias.c	1993/03/17 08:53:44
***************
*** 374,379 ****
--- 374,382 ----
  	register STAB *s;
  	char line[BUFSIZ];
  	char longest_lhs[BUFSIZ];
+ #ifdef _POSIX_SOURCE
+ 	sigset_t nset, oset;
+ #endif
  
  #ifdef YPMARK
  	if (AliasFile[0] == YPMARK)
***************
*** 422,434 ****
--- 425,447 ----
  
  	if (init)
  	{
+ #ifdef _POSIX_SOURCE
+ 	        (void) sigemptyset (&nset);
+ 		(void) sigaddset (&nset, SIGINT);
+ 	        (void) sigprocmask (SIG_BLOCK, &nset, &oset);
+ #else
  		oldsigint = signal(SIGINT, SIG_IGN);
+ #endif
  		(void) strcpy(line, AliasFile);
  		(void) strcat(line, DB_PAGEXT);
  		if (close(creat(line, DBMMODE)) < 0)
  		{
  			syserr("cannot make %s", line);
+ #ifdef _POSIX_SOURCE
+ 			(void) sigprocmask (SIG_SETMASK, &oset, NULL);
+ #else
  			(void) signal(SIGINT, oldsigint);
+ #endif
  			return;
  		}
  		(void) strcpy(line, AliasFile);
***************
*** 436,442 ****
--- 449,459 ----
  		if (close(creat(line, DBMMODE)) < 0)
  		{
  			syserr("cannot make %s", line);
+ #ifdef _POSIX_SOURCE
+ 			(void) sigprocmask (SIG_SETMASK, &oset, NULL);
+ #else
  			(void) signal(SIGINT, oldsigint);
+ #endif
  			return;
  		}
  #if defined(NDBM) || defined(OTHERDBM)
***************
*** 647,653 ****
--- 664,674 ----
  # endif /* NDBM || OTHERDBM */
  
  		/* restore the old signal */
+ #ifdef _POSIX_SOURCE
+ 		(void) sigprocmask (SIG_SETMASK, &oset, NULL);
+ #else
  		(void) signal(SIGINT, oldsigint);
+ #endif
  	}
  #endif /* DBM */
  
*** 5.9.0.14	1991/06/21 12:37:55
--- collect.c	1993/03/17 10:58:58
***************
*** 272,278 ****
  	eatheader(CurEnv, tf);
  
  	/* Now close the tf file */
! #ifndef SYSV
  	if (SuperSafe)
  		(void) fsync(fileno(tf));
  #endif /* !SYSV */
--- 272,278 ----
  	eatheader(CurEnv, tf);
  
  	/* Now close the tf file */
! #if !(defined(SYSV) || defined(linux))
  	if (SuperSafe)
  		(void) fsync(fileno(tf));
  #endif /* !SYSV */
*** 5.26.0.25	1991/06/21 12:38:29
--- conf.c	1993/03/17 08:35:11
***************
*** 550,556 ****
  **		Picks up extant zombies.
  */
  
! #ifdef VMUNIX
  # include <sys/wait.h>
  #endif /* VMUNIX */
  
--- 550,556 ----
  **		Picks up extant zombies.
  */
  
! #if defined (VMUNIX) || defined (_POSIX_SOURCE)
  # include <sys/wait.h>
  #endif /* VMUNIX */
  
***************
*** 558,563 ****
--- 558,570 ----
  reapchild()
  {
  	int pid;
+ #ifdef _POSIX_SOURCE
+ 	int status;
+ 
+ 	while ((pid = waitpid(-1, &status, WNOHANG)) != -1)
+ 		if (tTd(4, 2))
+ 			printf("reapchild: waitpid (pid = %d)\n", pid);
+ #else
  #ifdef LACK_WAIT3
  	int status;
  
***************
*** 577,582 ****
--- 584,590 ----
  		continue;
  	}
  #endif /* LACK_WAIT3 */
+ #endif /* _POSIX_SOURCE */
  #ifdef notdef
  #if ( SIG_TYPE == int )
  	return 0;
*** 5.17.0.20	1991/08/14 18:30:39
--- conf.h	1993/03/16 21:06:06
***************
*** 56,66 ****
  ** Compilation platform.  Include one from the following list:
  **
  ** 3b1.h aix3.h aixrt.h bsd43.h bsd44.h convex.h domainos.h dynix.h hpux.h
! ** irix.h isc.h next.h osx.h proto.h ptx.h riscos.h sunos4.h ultrix3.h
  ** ultrix4.h umax.h
  */
  
! # include "config/bsd44.h"
  
  /*
  **  Compilation options.
--- 56,66 ----
  ** Compilation platform.  Include one from the following list:
  **
  ** 3b1.h aix3.h aixrt.h bsd43.h bsd44.h convex.h domainos.h dynix.h hpux.h
! ** irix.h isc.h linux.h next.h osx.h proto.h ptx.h riscos.h sunos4.h ultrix3.h
  ** ultrix4.h umax.h
  */
  
! # include "config/linux.h"
  
  /*
  **  Compilation options.
***************
*** 75,82 ****
   * Define only 1 of the various {N,G,S,M,H}DBM libraries.  N.B., HDBM
   * assumes that ndbm.o was included in the libhash.a file.
   */
! # define NDBM		1	/* new DBM library available (requires DBM) */
! /*# define GDBM		1	/* gnu DBM library available (requires DBM) */
  /*# define SDBM		1	/* Ozan Yigit's PD ndbm (requires DBM) */
  /*# define MDBM		1	/* UMaryland's ndbm variant (requires DBM) */
  /*# define HDBM		1	/* Berkeley's hashing package (requires DBM) */
--- 75,82 ----
   * Define only 1 of the various {N,G,S,M,H}DBM libraries.  N.B., HDBM
   * assumes that ndbm.o was included in the libhash.a file.
   */
! /*# define NDBM		1	/* new DBM library available (requires DBM) */
! # define GDBM		1	/* gnu DBM library available (requires DBM) */
  /*# define SDBM		1	/* Ozan Yigit's PD ndbm (requires DBM) */
  /*# define MDBM		1	/* UMaryland's ndbm variant (requires DBM) */
  /*# define HDBM		1	/* Berkeley's hashing package (requires DBM) */
***************
*** 137,144 ****
  ** Comment out this line if you don't want sendmail to write a file with
  ** the daemon's pid.
  */
! /*# define	_PATH_SENDMAILPID   	"/var/run/sendmail.pid"	/* */
! # define	_PATH_SENDMAILPID	"/etc/sendmail.pid"	/* */
  
  /*
  ** Various hardware/OS #defines are used in the code.  Most of these
--- 137,144 ----
  ** Comment out this line if you don't want sendmail to write a file with
  ** the daemon's pid.
  */
! # define	_PATH_SENDMAILPID   	"/var/run/sendmail.pid"	/* */
! /*# define	_PATH_SENDMAILPID	"/etc/sendmail.pid"	/* */
  
  /*
  ** Various hardware/OS #defines are used in the code.  Most of these
*** 5.36.0.27	1991/08/12 17:52:32
--- daemon.c	1993/03/17 10:29:29
***************
*** 118,123 ****
--- 118,126 ----
  	int t;
  	register struct servent *sp;
  	int on = 1;
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ #endif
  
  	/*
  	**  Set up the address for the mailer.
***************
*** 176,182 ****
--- 179,192 ----
  	}
  
  # ifdef SIGCHLD
+ #  ifdef _POSIX_SOURCE
+ 	act.sa_handler = reapchild;
+ 	(void) sigemptyset(&act.sa_mask);
+ 	act.sa_flags = 0;
+ 	(void) sigaction(SIGCHLD, &act, NULL);
+ #  else
  	(void) signal(SIGCHLD, reapchild);
+ #  endif
  # endif /* SIGCHLD */
  
  	if (tTd(15, 1))
***************
*** 246,252 ****
--- 256,269 ----
  			*/
  
  # ifdef SIGCHLD
+ #  ifdef _POSIX_SOURCE
+ 			act.sa_handler = SIG_DFL;
+ 			(void) sigemptyset(&act.sa_mask);
+ 			act.sa_flags = 0;
+ 			(void) sigaction(SIGCHLD, &act, NULL);
+ #  else
  			(void) signal(SIGCHLD, SIG_DFL);
+ #  endif
  # endif /* SIGCHLD */
  
  			/* determine host name */
*** 5.38.0.32	1991/08/12 02:36:50
--- deliver.c	1993/03/17 09:24:11
***************
*** 857,862 ****
--- 857,865 ----
  	int mpvect[2];
  	int rpvect[2];
  	extern char **environ;
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ #endif
  
  	if (tTd(11, 1))
  	{
***************
*** 991,997 ****
--- 994,1007 ----
  		(void) fflush(CurEnv->e_xfp);		/* for debugging */
  	(void) fflush(stdout);
  #ifdef SIGCHLD
+ # ifdef _POSIX_SOURCE
+ 	act.sa_handler = SIG_DFL;
+ 	(void) sigemptyset(&act.sa_mask);
+ 	act.sa_flags = 0;
+ 	(void) sigaction(SIGCHLD, &act, NULL);
+ # else
  	(void) signal(SIGCHLD, SIG_DFL);
+ # endif
  #endif /* SIGCHLD */
  	DOFORK(XFORK);
  	/* pid is set by DOFORK */
***************
*** 1018,1026 ****
--- 1028,1046 ----
  
  		/* child -- set up input & exec mailer */
  		/* make diagnostic output be standard output */
+ #ifdef _POSIX_SOURCE
+ 		act.sa_handler = SIG_IGN;
+ 		(void) sigemptyset(&act.sa_mask);
+ 		act.sa_flags = 0;
+ 		(void) sigaction(SIGINT, &act, NULL);
+ 		(void) sigaction(SIGHUP, &act, NULL);
+ 		act.sa_handler = SIG_DFL;
+ 		(void) sigaction(SIGTERM, &act, NULL);
+ #else
  		(void) signal(SIGINT, SIG_IGN);
  		(void) signal(SIGHUP, SIG_IGN);
  		(void) signal(SIGTERM, SIG_DFL);
+ #endif
  
  		/* arrange to filter standard & diag output of command */
  		if (clever)
***************
*** 1507,1512 ****
--- 1527,1535 ----
  	register FILE *f;
  	register int pid = 0;
  	ENVELOPE *e = CurEnv;
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ #endif
  
  	/*
  	**  Fork so we can change permissions here.
***************
*** 1525,1533 ****
--- 1548,1565 ----
  		/* child -- actually write to file */
  		struct stat stb;
  
+ #ifdef _POSIX_SOURCE
+ 		act.sa_handler = SIG_DFL;
+ 		(void) sigemptyset(&act.sa_mask);
+ 		act.sa_flags = 0;
+ 		(void) sigaction(SIGINT, &act, NULL);
+ 		(void) sigaction(SIGHUP, &act, NULL);
+ 		(void) sigaction(SIGTERM, &act, NULL);
+ #else
  		(void) signal(SIGINT, SIG_DFL);
  		(void) signal(SIGHUP, SIG_DFL);
  		(void) signal(SIGTERM, SIG_DFL);
+ #endif
  		(void) umask(OldUmask);
  		if (stat(filename, &stb) < 0)
  		{
*** 5.38.0.32	1991/08/12 02:36:50
--- deliver.c	1993/03/17 09:24:11
***************
*** 857,862 ****
--- 857,865 ----
  	int mpvect[2];
  	int rpvect[2];
  	extern char **environ;
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ #endif
  
  	if (tTd(11, 1))
  	{
***************
*** 991,997 ****
--- 994,1007 ----
  		(void) fflush(CurEnv->e_xfp);		/* for debugging */
  	(void) fflush(stdout);
  #ifdef SIGCHLD
+ # ifdef _POSIX_SOURCE
+ 	act.sa_handler = SIG_DFL;
+ 	(void) sigemptyset(&act.sa_mask);
+ 	act.sa_flags = 0;
+ 	(void) sigaction(SIGCHLD, &act, NULL);
+ # else
  	(void) signal(SIGCHLD, SIG_DFL);
+ # endif
  #endif /* SIGCHLD */
  	DOFORK(XFORK);
  	/* pid is set by DOFORK */
***************
*** 1018,1026 ****
--- 1028,1046 ----
  
  		/* child -- set up input & exec mailer */
  		/* make diagnostic output be standard output */
+ #ifdef _POSIX_SOURCE
+ 		act.sa_handler = SIG_IGN;
+ 		(void) sigemptyset(&act.sa_mask);
+ 		act.sa_flags = 0;
+ 		(void) sigaction(SIGINT, &act, NULL);
+ 		(void) sigaction(SIGHUP, &act, NULL);
+ 		act.sa_handler = SIG_DFL;
+ 		(void) sigaction(SIGTERM, &act, NULL);
+ #else
  		(void) signal(SIGINT, SIG_IGN);
  		(void) signal(SIGHUP, SIG_IGN);
  		(void) signal(SIGTERM, SIG_DFL);
+ #endif
  
  		/* arrange to filter standard & diag output of command */
  		if (clever)
***************
*** 1507,1512 ****
--- 1527,1535 ----
  	register FILE *f;
  	register int pid = 0;
  	ENVELOPE *e = CurEnv;
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ #endif
  
  	/*
  	**  Fork so we can change permissions here.
***************
*** 1525,1533 ****
--- 1548,1565 ----
  		/* child -- actually write to file */
  		struct stat stb;
  
+ #ifdef _POSIX_SOURCE
+ 		act.sa_handler = SIG_DFL;
+ 		(void) sigemptyset(&act.sa_mask);
+ 		act.sa_flags = 0;
+ 		(void) sigaction(SIGINT, &act, NULL);
+ 		(void) sigaction(SIGHUP, &act, NULL);
+ 		(void) sigaction(SIGTERM, &act, NULL);
+ #else
  		(void) signal(SIGINT, SIG_DFL);
  		(void) signal(SIGHUP, SIG_DFL);
  		(void) signal(SIGTERM, SIG_DFL);
+ #endif
  		(void) umask(OldUmask);
  		if (stat(filename, &stb) < 0)
  		{
*** 1.16	1991/06/21 12:51:15
--- getloadavg.c	1993/03/17 14:32:28
***************
*** 319,324 ****
--- 319,329 ----
  #    include <sys/vm.h>
  #   endif /* sequent */
  
+ #   ifdef linux
+ #    include <linux/sched.h>
+ #    define FSCALE FIXED_1
+ #   endif /* linux */
+ 
  #   ifdef macII
  #    include <a.out.h>
  #    include <sys/var.h>
***************
*** 500,505 ****
--- 505,515 ----
  #        define KERNEL_FILE "/dynix"
  #       endif /* sequent */
  
+ #       ifdef linux
+ #        define KERNEL_FILE "/vmlinux"
+ #        define KERNEL_FILE2 "/usr/src/linux/tools/system"
+ #       endif /* linux */
+ 
  /*
   * provide default for everyone else
   */
***************
*** 650,656 ****
  		init = 1;
          }
  #      else /* !unixpc */
! #       if !defined(sgi) && !defined(BSD4_4)
  	extern void nlist();
  #       else /* sgi || BSD4_4 */
  	extern nlist();
--- 660,666 ----
  		init = 1;
          }
  #      else /* !unixpc */
! #       if !defined(sgi) && !defined(BSD4_4) && !defined(linux)
  	extern void nlist();
  #       else /* sgi || BSD4_4 */
  	extern nlist();
***************
*** 657,663 ****
  #       endif /* !sgi && !BSD4_4 */
  
  	if(!init)   {
! 	    nlist( KERNEL_FILE, namelist);
  /*
   * Some systems appear to set only one of these to Zero if the entry could
   * not be found, I hope no_one returns Zero as a good value, or bad things
--- 667,679 ----
  #       endif /* !sgi && !BSD4_4 */
  
  	if(!init)   {
! 	    if (nlist( KERNEL_FILE, namelist ) == -1)	{
! #       ifdef KERNEL_FILE2
! 		(void) nlist( KERNEL_FILE2, namelist );
! #       else
! 		;
! #       endif
! 	    }
  /*
   * Some systems appear to set only one of these to Zero if the entry could
   * not be found, I hope no_one returns Zero as a good value, or bad things
***************
*** 691,697 ****
  #     endif /* macII */
  #     if defined(sun) || defined (UTEK) || defined(sequent) || \
        defined(alliant) || defined(hp9000) || defined(sgi) || defined(NeXT) || \
!       defined(unixpc)
  	{
  		long temp;
  		(void) read(kmem, (char *)&temp, sizeof(long));
--- 707,713 ----
  #     endif /* macII */
  #     if defined(sun) || defined (UTEK) || defined(sequent) || \
        defined(alliant) || defined(hp9000) || defined(sgi) || defined(NeXT) || \
!       defined(unixpc) || defined(linux)
  	{
  		long temp;
  		(void) read(kmem, (char *)&temp, sizeof(long));
*** 5.29.0.36	1991/08/06 18:17:12
--- main.c	1993/03/17 13:17:04
***************
*** 147,152 ****
--- 147,156 ----
  	char *UserEnviron[MAXUSERENVIRON+1];	/* saved user environment */
  	extern char **environ;
  #endif /* SETPROCTITLE && !SYSV */
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ 	struct sigaction oact;
+ #endif
  
  	/*
  	**  Check to see if we reentered.
***************
*** 303,308 ****
--- 307,328 ----
  	_res.retrans = 30;
  #endif /* NAMED_BIND */
  
+ #ifdef _POSIX_SOURCE
+ 	act.sa_handler = intsig;
+ 	(void) sigemptyset(&act.sa_mask);
+ 	act.sa_flags = 0;
+ 	if (sigaction(SIGINT, NULL, &oact) != 0
+ 	    || oact.sa_handler != SIG_IGN)	{
+ 	    (void) sigaction(SIGINT, &act, NULL);
+ 	}
+ 	if (sigaction(SIGHUP, NULL, &oact) != 0
+ 	    || oact.sa_handler != SIG_IGN)	{
+ 	    (void) sigaction(SIGHUP, &act, NULL);
+ 	}
+ 	(void) sigaction(SIGTERM, &act, NULL);
+ 	act.sa_handler = SIG_IGN;
+ 	(void) sigaction(SIGPIPE, &act, NULL);
+ #else
  	if (signal(SIGINT, SIG_IGN) != (SIG_TYPE (*)()) SIG_IGN)
  		(void) signal(SIGINT, intsig);
  	if (signal(SIGHUP, SIG_IGN) != (SIG_TYPE (*)()) SIG_IGN)
***************
*** 309,314 ****
--- 329,335 ----
  		(void) signal(SIGHUP, intsig);
  	(void) signal(SIGTERM, intsig);
  	(void) signal(SIGPIPE, SIG_IGN);
+ #endif
  	OldUmask = umask(0);
  	OpMode = MD_DELIVER;
  	MotherPid = getpid();
***************
*** 1300,1305 ****
--- 1321,1329 ----
  	bool fulldrop;
  {
  	int fd;
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ #endif
  
  	if (tTd(52, 1))
  		printf("disconnect: In %d Out %d\n", fileno(InChannel),
***************
*** 1311,1319 ****
--- 1335,1352 ----
  	}
  
  	/* be sure we don't get nasty signals */
+ #ifdef _POSIX_SOURCE
+ 	act.sa_handler = SIG_IGN;
+ 	(void) sigemptyset(&act.sa_mask);
+ 	act.sa_flags = 0;
+ 	(void) sigaction(SIGHUP, &act, NULL);
+ 	(void) sigaction(SIGINT, &act, NULL);
+ 	(void) sigaction(SIGQUIT, &act, NULL);
+ #else
  	(void) signal(SIGHUP, SIG_IGN);
  	(void) signal(SIGINT, SIG_IGN);
  	(void) signal(SIGQUIT, SIG_IGN);
+ #endif
  
  	/* we can't communicate with our caller, so.... */
  	HoldErrs = TRUE;
*** 5.30.0.28	1991/06/24 14:26:25
--- queue.c	1993/03/17 09:41:01
***************
*** 385,390 ****
--- 385,393 ----
  runqueue(forkflag)
  	bool forkflag;
  {
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ #endif
  	/*
  	**  If no work will ever be selected, don't even bother reading
  	**  the queue.
***************
*** 419,425 ****
--- 422,435 ----
  # ifndef SIGCHLD
  			(void) waitfor(pid);
  # else /* SIGCHLD */
+ #  ifdef _POSIX_SOURCE
+ 			act.sa_handler = reapchild;
+ 			(void) sigemptyset(&act.sa_mask);
+ 			act.sa_flags = 0;
+ 			(void) sigaction(SIGCHLD, &act, NULL);
+ #  else
  			(void) signal(SIGCHLD, reapchild);
+ #  endif
  # endif /* !SIGCHLD */
  			if (QueueIntvl != 0)
  				(void) setevent(QueueIntvl, runqueue, TRUE);
***************
*** 430,436 ****
--- 440,453 ----
  		if (fork() != 0)
  			exit(EX_OK);
  # else /* SIGCHLD */
+ #  ifdef _POSIX_SOURCE
+ 		act.sa_handler = SIG_DFL;
+ 		(void) sigemptyset(&act.sa_mask);
+ 		act.sa_flags = 0;
+ 		(void) sigaction(SIGCHLD, &act, NULL);
+ #  else
  		(void) signal(SIGCHLD, SIG_DFL);
+ #  endif
  # endif /* !SIGCHLD */
  	}
  
*** 5.16.0.24	1991/08/14 18:28:19
--- sendmail.h	1993/03/17 10:03:37
***************
*** 36,46 ****
  
  # include "conf.h"
  # include <stdio.h>
! # ifdef SYSV
  #  include <signal.h>
  # else /* !SYSV */
  #  include <sys/signal.h>
! # endif /* SYSV */
  # if defined(SYSV) 
  #  include <time.h>
  # else /* !SYSV */
--- 36,46 ----
  
  # include "conf.h"
  # include <stdio.h>
! # if defined(_POSIX_SOURCE) || defined(SYSV)
  #  include <signal.h>
  # else /* !SYSV */
  #  include <sys/signal.h>
! # endif /* _POSIX_SOURCE || SYSV */
  # if defined(SYSV) 
  #  include <time.h>
  # else /* !SYSV */
***************
*** 58,64 ****
  #  include "flock.h"
  # endif /* !LOCK_EX */
  
! # if defined(hpux) || defined(_CONVEX_SOURCE) || defined(DGUX)
  #  define XPG3           /* X-Open Portability Guide 3 */
  #  include <unistd.h>
  #  ifndef direct
--- 58,64 ----
  #  include "flock.h"
  # endif /* !LOCK_EX */
  
! # if defined(_POSIX_SOURCE) || defined(hpux) || defined(_CONVEX_SOURCE) || defined(DGUX)
  #  define XPG3           /* X-Open Portability Guide 3 */
  #  include <unistd.h>
  #  ifndef direct
*** 5.28.0.15	1991/06/24 20:27:06
--- srvrsmtp.c	1993/03/17 09:42:56
***************
*** 20,26 ****
  
  #include "sendmail.h"
  #include <errno.h>
- #include <sys/signal.h>
  
  #ifndef lint
  # ifdef SMTP
--- 20,25 ----
*** 5.20.0.1	1991/06/24 20:30:05
--- syslog.c	1993/03/17 10:54:34
***************
*** 58,64 ****
  static int	LogFile = -1;		/* fd for log */
  static int	connected;		/* have done connect */
  static int	LogStat = 0;		/* status bits, set by openlog() */
! static char	*LogTag = "syslog";	/* string to tag the entry with */
  static int	LogFacility = LOG_USER;	/* default facility code */
  
  # ifndef __STDC__
--- 58,64 ----
  static int	LogFile = -1;		/* fd for log */
  static int	connected;		/* have done connect */
  static int	LogStat = 0;		/* status bits, set by openlog() */
! static const char *LogTag = "syslog";	/* string to tag the entry with */
  static int	LogFacility = LOG_USER;	/* default facility code */
  
  # ifndef __STDC__
***************
*** 89,94 ****
--- 89,98 ----
  	int pid, saved_errno;
  	char tbuf[2048], fmt_cpy[1024];
  	unsigned int more_time;
+ #ifdef _POSIX_SOURCE
+ 	struct sigaction act;
+ 	sigset_t set;
+ #endif
  
  # ifdef __STDC__
  	va_start(ap, fmt);
***************
*** 147,155 ****
--- 151,165 ----
  	va_end(ap);
  
  	/* output the message to the local logger */
+ #ifdef SYSLOG_USE_FIFO
+ 	if (write(LogFile, tbuf, cnt) >= 0 ||
+ 	    !(LogStats&LOG_CONS))
+     		return;
+ #else
  	if (send(LogFile, tbuf, cnt = strlen(tbuf), 0) >= 0 ||
  	    !(LogStat&LOG_CONS))
  		return;
+ #endif
  
  	/* output the message to the console */
  	pid = vfork();
***************
*** 158,167 ****
--- 168,188 ----
  	if (pid == 0) {
  		int fd;
  
+ #ifdef _POSIX_SOURCE
+ 		act.sa_handler = SIG_DFL;
+ 		(void) sigemptyset(&act.sa_mask);
+ 		act.sa_flags = 0;
+ 		(void) sigaction(SIGALRM, &act, NULL);
+ 		/* Make sure SIGALRM is not blocked */
+ 		(void) sigemptyset(&set);
+ 		(void) sigaddset(&set, SIGALRM);
+ 		(void) sigprocmask(SIG_UNBLOCK, &set, NULL);
+ #else
  		(void)signal(SIGALRM, SIG_DFL);
  # ifndef SYSV
  		sigsetmask((long)~sigmask(SIGALRM));
  # endif /* !SYSV */
+ #endif
  		more_time = 5;
  		while (more_time = alarm(more_time))
  			;
***************
*** 178,185 ****
--- 199,208 ----
  		while ((cnt = wait((int *)0)) > 0 && cnt != pid);
  }
  
+ #ifndef SYSLOG_USE_FIFO
  static struct sockaddr SyslogAddr;	/* AF_UNIX address of local logger */
  static struct sockaddr_in SyslogPort;	/* AF_INET address of local logger */
+ #endif
  /*
   * OPENLOG -- open system log
   */
***************
*** 194,206 ****
--- 217,240 ----
  	if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
  		LogFacility = logfac;
  	if (LogFile == -1) {
+ #ifndef SYSLOG_USE_FIFO
  		SyslogAddr.sa_family = AF_UNIX;
  		strncpy(SyslogAddr.sa_data, LOGNAME, sizeof SyslogAddr.sa_data);
+ #endif
  		if (LogStat & LOG_NDELAY) {
+ #ifdef SYSLOG_USE_FIFO
+ 			/* Opening FIFO with O_RDWR guarantees no
+ 			 * blocking according to kernel fs comments
+ 			 */
+ 			if ((LogFile = open(_PATH_LOG, O_WRONLY|O_NONBLOCK, 0)) >= 0)
+ 			    connected = 1;
+ #else
  			LogFile = socket(AF_UNIX, SOCK_DGRAM, 0);
  			fcntl(LogFile, F_SETFD, 1);
+ #endif
  		}
  	}
+ #ifndef SYSLOG_USE_FIFO
  	if (LogFile != -1 && !connected &&
  	    connect(LogFile, &SyslogAddr, sizeof(SyslogAddr)) != -1) {
  		connected = 1;
***************
*** 234,239 ****
--- 268,279 ----
  		connected = 1;
  		return;
  	} else {
+ 		LogStat |= LOG_CONS;
+ 		if (LogFile != -1)
+ 			(void) close(LogFile);
+ 	}
+ #endif
+ 	if (LogFile == -1 || !connected)	{
  		LogStat |= LOG_CONS;
  		if (LogFile != -1)
  			(void) close(LogFile);
*** /dev/null	Fri Jul 10 09:06:40 1992
--- config/linux.h	Wed Mar 17 11:55:15 1993
***************
*** 0 ****
--- 1,29 ----
+ /*
+  * Copyright (c) 1983 Eric P. Allman
+  * Copyright (c) 1988 Regents of the University of California.
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms are permitted provided
+  * that: (1) source distributions retain this entire copyright notice and
+  * comment, and (2) distributions including binaries display the following
+  * acknowledgement:  ``This product includes software developed by the
+  * University of California, Berkeley and its contributors'' in the
+  * documentation or other materials provided with the distribution and in
+  * all advertising materials mentioning features or use of this software.
+  * Neither the name of the University nor the names of its contributors may
+  * be used to endorse or promote products derived from this software without
+  * specific prior written permission.
+  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+  */
+ 
+ /*
+ **  LINUX.H -- configurable parameters for sendmail on Linux/386 platforms.
+ */
+ 
+ #define VMUNIX		1	/* running on systems w. 4.2/4.3 networking */
+ #define SIG_TYPE	void	/* Value returned by signal() */
+ #define TIME_TYPE	time_t	/* Value used and returned by time() */
+ #define _POSIX_SOURCE	1	/* Linux is POSIX compliant */
+ #define SYSLOG_USE_FIFO	1	/* /dev/log is a fifo */
