install VAX mpx file logging
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 1 Mar 1981 03:54:11 +0000 (19:54 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 1 Mar 1981 03:54:11 +0000 (19:54 -0800)
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 2.6
SCCS-vsn: usr.sbin/sendmail/src/err.c 2.3
SCCS-vsn: usr.sbin/sendmail/src/main.c 2.4
SCCS-vsn: usr.sbin/sendmail/src/version.c 2.8

usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/err.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/version.c

index a51ca15..069a316 100644 (file)
@@ -3,10 +3,10 @@
 # include <signal.h>
 # include "dlvrmail.h"
 # ifdef LOG
 # include <signal.h>
 # include "dlvrmail.h"
 # ifdef LOG
-# include <log.h>
+# include <syslog.h>
 # endif LOG
 
 # endif LOG
 
-static char SccsId[] = "@(#)deliver.c  2.5     %G%";
+static char SccsId[] = "@(#)deliver.c  2.6     %G%";
 
 /*
 **  DELIVER -- Deliver a message to a particular address.
 
 /*
 **  DELIVER -- Deliver a message to a particular address.
@@ -219,23 +219,29 @@ deliver(to, editfcn)
                }
                if (!flagset(M_RESTR, m->m_flags))
                        setuid(getuid());
                }
                if (!flagset(M_RESTR, m->m_flags))
                        setuid(getuid());
-# ifdef LOG
-               closelog();
-# endif LOG
 # ifndef VFORK
                /*
 # ifndef VFORK
                /*
-                * We have to be careful with vfork - we can't mung up the
-                * memory but we don't want the mailer to inherit any extra
-                * open files.  Chances are the mailer won't
-                * care about an extra file, but then again you never know.
-                * Actually, we would like to close(fileno(pwf)), but it's
-                * declared static so we can't.  But if we fclose(pwf), which
-                * is what endpwent does, it closes it in the parent too and
-                * the next getpwnam will be slower.  If you have a weird mailer
-                * that chokes on the extra file you should do the endpwent().
-                */
+               **  We have to be careful with vfork - we can't mung up the
+               **  memory but we don't want the mailer to inherit any extra
+               **  open files.  Chances are the mailer won't
+               **  care about an extra file, but then again you never know.
+               **  Actually, we would like to close(fileno(pwf)), but it's
+               **  declared static so we can't.  But if we fclose(pwf), which
+               **  is what endpwent does, it closes it in the parent too and
+               **  the next getpwnam will be slower.  If you have a weird
+               **  mailer that chokes on the extra file you should do the
+               **  endpwent().
+               **
+               **  Similar comments apply to log.  However, openlog is
+               **  clever enough to set the FIOCLEX mode on the file,
+               **  so it will be closed automatically on the exec.
+               */
+
                endpwent();
                endpwent();
-# endif
+# ifdef LOG
+               closelog();
+# endif LOG
+# endif VFORK
                execv(m->m_mailer, pvp);
                /* syserr fails because log is closed */
                /* syserr("Cannot exec %s", m->m_mailer); */
                execv(m->m_mailer, pvp);
                /* syserr fails because log is closed */
                /* syserr("Cannot exec %s", m->m_mailer); */
@@ -355,7 +361,7 @@ giveresponse(stat, force, m)
        }
 
 # ifdef LOG
        }
 
 # ifdef LOG
-       logmsg(LOG_INFO, "%s->%s: %ld: %s", From.q_paddr, To, MsgSize, statmsg);
+       syslog(LOG_INFO, "%s->%s: %ld: %s", From.q_paddr, To, MsgSize, statmsg);
 # endif LOG
        setstat(stat);
        return (stat);
 # endif LOG
        setstat(stat);
        return (stat);
index 7b51f32..9c49503 100644 (file)
@@ -1,10 +1,10 @@
 # include <stdio.h>
 # include "dlvrmail.h"
 # ifdef LOG
 # include <stdio.h>
 # include "dlvrmail.h"
 # ifdef LOG
-# include <log.h>
+# include <syslog.h>
 # endif LOG
 
 # endif LOG
 
-static char    SccsId[] = "@(#)err.c   2.2     %G%";
+static char    SccsId[] = "@(#)err.c   2.3     %G%";
 
 /*
 **  SYSERR -- Print error message.
 
 /*
 **  SYSERR -- Print error message.
@@ -57,7 +57,7 @@ syserr(fmt, a, b, c, d, e)
        }
 
 # ifdef LOG
        }
 
 # ifdef LOG
-       logmsg(LOG_ERR, "%s->%s: %s", From.q_paddr, To, errbuf);
+       syslog(LOG_ERR, "%s->%s: %s", From.q_paddr, To, errbuf);
 # endif LOG
        errno = 0;
        return (-1);
 # endif LOG
        errno = 0;
        return (-1);
index ddc80be..4d158bb 100644 (file)
@@ -3,10 +3,10 @@
 # include <ctype.h>
 # include "dlvrmail.h"
 # ifdef LOG
 # include <ctype.h>
 # include "dlvrmail.h"
 # ifdef LOG
-# include <log.h>
+# include <syslog.h>
 # endif LOG
 
 # endif LOG
 
-static char    SccsId[] = "@(#)main.c  2.3     %G%";
+static char    SccsId[] = "@(#)main.c  2.4     %G%";
 
 /*
 **  DELIVERMAIL -- Deliver mail to a set of destinations
 
 /*
 **  DELIVERMAIL -- Deliver mail to a set of destinations
index 1fb46d9..86a4d6b 100644 (file)
@@ -1 +1 @@
-char   Version[] = "@(#)Delivermail version 2.7 of %G%";
+char   Version[] = "@(#)Delivermail version 2.8 of %G%";