FreeBSD Bugzilla – Attachment 13624 Details for
Bug 25833
LOG_FAC() is bogus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.31 KB, created by
Tony Finch
on 2001-03-15 19:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Tony Finch
Created:
2001-03-15 19:20:01 UTC
Size:
2.31 KB
patch
obsolete
>Index: sys/sys/syslog.h >=================================================================== >RCS file: /home/ncvs/src/sys/sys/syslog.h,v >retrieving revision 1.19.2.1 >diff -u -r1.19.2.1 syslog.h >--- sys/sys/syslog.h 2001/01/09 06:51:34 1.19.2.1 >+++ sys/sys/syslog.h 2001/03/15 11:54:45 >@@ -121,8 +121,9 @@ > > #define LOG_NFACILITIES 24 /* current number of facilities */ > #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ >+#define LOG_FACSHIFT 3 /* number of bits below the facility */ > /* facility of pri */ >-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) >+#define LOG_FAC(p) ((p) & LOG_FACMASK) > > #ifdef SYSLOG_NAMES > CODE facilitynames[] = { >Index: usr.sbin/syslogd/syslogd.c >=================================================================== >RCS file: /home/ncvs/src/usr.sbin/syslogd/syslogd.c,v >retrieving revision 1.59.2.6 >diff -u -r1.59.2.6 syslogd.c >--- usr.sbin/syslogd/syslogd.c 2001/02/18 16:22:59 1.59.2.6 >+++ usr.sbin/syslogd/syslogd.c 2001/03/15 11:45:18 >@@ -710,7 +710,7 @@ > pri = 10 * pri + (*p - '0'); > if (*p == '>') > ++p; >- if ((pri & LOG_FACMASK) == LOG_CONSOLE) >+ if (LOG_FAC(pri) == LOG_CONSOLE) > flags |= IGN_CONS; > } else { > /* kernel printf's come out on console */ >@@ -771,7 +771,7 @@ > if (flags & MARK) > fac = LOG_NFACILITIES; > else >- fac = LOG_FAC(pri); >+ fac = LOG_FAC(pri) >> LOG_FACSHIFT; > prilev = LOG_PRI(pri); > > /* extract program name */ >@@ -913,7 +913,7 @@ > > if (LogFacPri) { > static char fp_buf[30]; /* Hollow laugh */ >- int fac = f->f_prevpri & LOG_FACMASK; >+ int fac = LOG_FAC(f->f_prevpri); > int pri = LOG_PRI(f->f_prevpri); > char *f_s = 0; > char f_n[5]; /* Hollow laugh */ >@@ -937,7 +937,7 @@ > } > } > if (!f_s) { >- snprintf(f_n, sizeof f_n, "%d", LOG_FAC(fac)); >+ snprintf(f_n, sizeof f_n, "%d", fac >> LOG_FACSHIFT); > f_s = f_n; > } > if (!p_s) { >Index: lib/libc/gen/syslog.c >=================================================================== >RCS file: /home/ncvs/src/lib/libc/gen/syslog.c,v >retrieving revision 1.21 >diff -u -r1.21 syslog.c >--- lib/libc/gen/syslog.c 2000/01/27 23:06:20 1.21 >+++ lib/libc/gen/syslog.c 2001/03/15 11:36:26 >@@ -161,7 +161,7 @@ > saved_errno = errno; > > /* Set default facility if none specified. */ >- if ((pri & LOG_FACMASK) == 0) >+ if (LOG_FAC(pri) == 0) > pri |= LogFacility; > > /* Create the primary stdio hook */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 25833
: 13624