summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6e29ad7)
SCCS-vsn: usr.sbin/syslogd/syslogd.c 5.13
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)syslogd.c 5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)syslogd.c 5.13 (Berkeley) %G%";
#define DEFSPRI (LOG_KERN|LOG_CRIT)
#define MARKCOUNT 10 /* ratio of minor to major marks */
#define DEFSPRI (LOG_KERN|LOG_CRIT)
#define MARKCOUNT 10 /* ratio of minor to major marks */
#include <errno.h>
#include <stdio.h>
#include <utmp.h>
#include <errno.h>
#include <stdio.h>
#include <utmp.h>
#include <sysexits.h>
#include <strings.h>
#include <sysexits.h>
#include <strings.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#define MAXFNAME 200 /* max file pathname length */
#define NOPRI 0x10 /* the "no priority" priority */
#define MAXFNAME 200 /* max file pathname length */
#define NOPRI 0x10 /* the "no priority" priority */
+#define LOG_MARK (LOG_NFACILITIES << 3) /* mark "facility" */
short f_type; /* entry type, see below */
short f_file; /* file descriptor */
time_t f_time; /* time this was last written */
short f_type; /* entry type, see below */
short f_file; /* file descriptor */
time_t f_time; /* time this was last written */
- u_char f_pmask[LOG_NFACILITIES]; /* priority mask */
+ u_char f_pmask[LOG_NFACILITIES+1]; /* priority mask */
union {
char f_uname[MAXUNAMES][UNAMESZ+1];
union {
char f_uname[MAXUNAMES][UNAMESZ+1];
char f_hname[MAXHOSTNAMELEN+1];
struct sockaddr_in f_addr;
char f_hname[MAXHOSTNAMELEN+1];
struct sockaddr_in f_addr;
- } f_forw; /* forwarding address */
+ } f_forw; /* forwarding address */
};
/* values for f_type */
};
/* values for f_type */
/* extract facility and priority level */
fac = (pri & LOG_FACMASK) >> 3;
/* extract facility and priority level */
fac = (pri & LOG_FACMASK) >> 3;
+ if (flags & MARK)
+ fac = LOG_NFACILITIES;
prilev = pri & LOG_PRIMASK;
/* log the message to the particular outputs */
prilev = pri & LOG_PRIMASK;
/* log the message to the particular outputs */
int pri;
if ((++MarkSeq % MARKCOUNT) == 0)
int pri;
if ((++MarkSeq % MARKCOUNT) == 0)
- logmsg(LOG_SYSLOG|LOG_INFO, "-- MARK --", LocalHostName, ADDDATE|MARK);
+ logmsg(LOG_INFO, "-- MARK --", LocalHostName, ADDDATE|MARK);
else
flushmsg();
alarm(MarkInterval * 60 / MARKCOUNT);
else
flushmsg();
alarm(MarkInterval * 60 / MARKCOUNT);
if (Debug) {
for (f = Files; f < &Files[NLOGS]; f++) {
if (Debug) {
for (f = Files; f < &Files[NLOGS]; f++) {
- for (i = 0; i < LOG_NFACILITIES; i++)
+ for (i = 0; i <= LOG_NFACILITIES; i++)
if (f->f_pmask[i] == NOPRI)
printf("X ");
else
if (f->f_pmask[i] == NOPRI)
printf("X ");
else
"daemon", LOG_DAEMON,
"auth", LOG_AUTH,
"security", LOG_AUTH,
"daemon", LOG_DAEMON,
"auth", LOG_AUTH,
"security", LOG_AUTH,
"syslog", LOG_SYSLOG,
"lpr", LOG_LPR,
"local0", LOG_LOCAL0,
"syslog", LOG_SYSLOG,
"lpr", LOG_LPR,
"local0", LOG_LOCAL0,
/* clear out file entry */
bzero((char *) f, sizeof *f);
/* clear out file entry */
bzero((char *) f, sizeof *f);
- for (i = 0; i < LOG_NFACILITIES; i++)
+ for (i = 0; i <= LOG_NFACILITIES; i++)
f->f_pmask[i] = NOPRI;
/* scan through the list of selectors */
f->f_pmask[i] = NOPRI;
/* scan through the list of selectors */