View | Details | Raw Unified | Return to bug 25833
Collapse All | Expand All

(-)sys/sys/syslog.h (-1 / +2 lines)
Lines 121-128 Link Here
121
121
122
#define	LOG_NFACILITIES	24	/* current number of facilities */
122
#define	LOG_NFACILITIES	24	/* current number of facilities */
123
#define	LOG_FACMASK	0x03f8	/* mask to extract facility part */
123
#define	LOG_FACMASK	0x03f8	/* mask to extract facility part */
124
#define	LOG_FACSHIFT	3	/* number of bits below the facility */
124
				/* facility of pri */
125
				/* facility of pri */
125
#define	LOG_FAC(p)	(((p) & LOG_FACMASK) >> 3)
126
#define	LOG_FAC(p)	((p) & LOG_FACMASK)
126
127
127
#ifdef SYSLOG_NAMES
128
#ifdef SYSLOG_NAMES
128
CODE facilitynames[] = {
129
CODE facilitynames[] = {
(-)usr.sbin/syslogd/syslogd.c (-4 / +4 lines)
Lines 710-716 Link Here
710
			pri = 10 * pri + (*p - '0');
710
			pri = 10 * pri + (*p - '0');
711
		if (*p == '>')
711
		if (*p == '>')
712
			++p;
712
			++p;
713
		if ((pri & LOG_FACMASK) == LOG_CONSOLE)
713
		if (LOG_FAC(pri) == LOG_CONSOLE)
714
			flags |= IGN_CONS;
714
			flags |= IGN_CONS;
715
	} else {
715
	} else {
716
		/* kernel printf's come out on console */
716
		/* kernel printf's come out on console */
Lines 771-777 Link Here
771
	if (flags & MARK)
771
	if (flags & MARK)
772
		fac = LOG_NFACILITIES;
772
		fac = LOG_NFACILITIES;
773
	else
773
	else
774
		fac = LOG_FAC(pri);
774
		fac = LOG_FAC(pri) >> LOG_FACSHIFT;
775
	prilev = LOG_PRI(pri);
775
	prilev = LOG_PRI(pri);
776
776
777
	/* extract program name */
777
	/* extract program name */
Lines 913-919 Link Here
913
913
914
	if (LogFacPri) {
914
	if (LogFacPri) {
915
	  	static char fp_buf[30];	/* Hollow laugh */
915
	  	static char fp_buf[30];	/* Hollow laugh */
916
		int fac = f->f_prevpri & LOG_FACMASK;
916
		int fac = LOG_FAC(f->f_prevpri);
917
		int pri = LOG_PRI(f->f_prevpri);
917
		int pri = LOG_PRI(f->f_prevpri);
918
		char *f_s = 0;
918
		char *f_s = 0;
919
		char f_n[5];	/* Hollow laugh */
919
		char f_n[5];	/* Hollow laugh */
Lines 937-943 Link Here
937
		  }
937
		  }
938
		}
938
		}
939
		if (!f_s) {
939
		if (!f_s) {
940
		  snprintf(f_n, sizeof f_n, "%d", LOG_FAC(fac));
940
		  snprintf(f_n, sizeof f_n, "%d", fac >> LOG_FACSHIFT);
941
		  f_s = f_n;
941
		  f_s = f_n;
942
		}
942
		}
943
		if (!p_s) {
943
		if (!p_s) {
(-)lib/libc/gen/syslog.c (-1 / +1 lines)
Lines 161-167 Link Here
161
	saved_errno = errno;
161
	saved_errno = errno;
162
162
163
	/* Set default facility if none specified. */
163
	/* Set default facility if none specified. */
164
	if ((pri & LOG_FACMASK) == 0)
164
	if (LOG_FAC(pri) == 0)
165
		pri |= LogFacility;
165
		pri |= LogFacility;
166
166
167
	/* Create the primary stdio hook */
167
	/* Create the primary stdio hook */

Return to bug 25833