syslog portability for HP-UX; fix typo for OSF/1 pid file
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 6 Jan 1994 02:20:12 +0000 (18:20 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 6 Jan 1994 02:20:12 +0000 (18:20 -0800)
SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.73
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.61

usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/conf.h

index a5e7303..6dd35f3 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     8.60 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     8.61 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -2034,3 +2034,37 @@ ni_propval(directory, propname)
 }
 
 #endif /* NETINFO */
 }
 
 #endif /* NETINFO */
+\f/*
+**  HARD_SYSLOG -- call syslog repeatedly until it works
+**
+**     Needed on HP-UX, which apparently doesn't guarantee that
+**     syslog succeeds during interrupt handlers.
+*/
+
+#ifdef __hpux
+
+# define MAXSYSLOGTRIES        100
+# undef syslog
+
+# ifdef __STDC__
+hard_syslog(int pri, char *msg, ...)
+# else
+hard_syslog(pri, msg, va_alist)
+       int pri;
+       char *msg;
+       va_dcl
+# endif
+{
+       int i;
+       char buf[SYSLOG_BUFSIZE * 2];
+       VA_LOCAL_DECL;
+
+       VA_START(msg);
+       vsprintf(buf, msg, ap);
+       VA_END;
+
+       for (i = MAXSYSLOGTRIES; --i >= 0 && syslog(pri, "%s", buf) < 0; )
+               continue;
+}
+
+#endif
index 919ec58..f13d424 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      8.72 (Berkeley) %G%
+ *     @(#)conf.h      8.73 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 # ifndef IDENTPROTO
 #  define IDENTPROTO   0       /* TCP/IP implementation is broken */
 # endif
 # ifndef IDENTPROTO
 #  define IDENTPROTO   0       /* TCP/IP implementation is broken */
 # endif
+# define syslog                hard_syslog
 # endif
 
 
 # endif
 
 
@@ -280,7 +281,7 @@ extern long dgux_inet_addr();
 # define HASFLOCK      1       /* has flock(2) call */
 # define LA_TYPE       LA_INT
 # ifndef _PATH_SENDMAILPID
 # define HASFLOCK      1       /* has flock(2) call */
 # define LA_TYPE       LA_INT
 # ifndef _PATH_SENDMAILPID
-#  define _PATH_SENDMAILPID    "/var/run/sendmial.pid"
+#  define _PATH_SENDMAILPID    "/var/run/sendmail.pid"
 # endif
 #endif
 
 # endif
 #endif