On Wed, Oct 13, 2010 at 12:32 PM, Nick <open...@acrasis.net> wrote:
> On not seeing some expected log messages, I wrote this test program
'log.c':
>
>   #include <stdlib.h>
>   #include <syslog.h>
>
>   int
>   main (int argc, char **argv)
>   {
>      openlog("logtest", 0, 0);
>      syslog(LOG_MAKEPRI(LOG_USER, LOG_INFO),
>             "hello1: via LOG_MAKPRI.\n");
>      syslog(LOG_INFO | LOG_USER, "hello2: via bitwise-or.\n");
>      syslog(LOG_INFO, "hello3: via level only.\n");
>      closelog();
>      return EXIT_SUCCESS;
>   }
>
> and compiled it with 'gcc -o log log.c'.  On Debian 'Squeeze' all
> three messages appear in the log.  On OpenBSD 4.7 only the last two
> appear in the log.
>
> So it looks like LOG_MAKEPRI and syslogd are not on speaking terms.
> LOG_MAKEPRI is not documented in syslog(3) but is present in syslog.h.
>
> LOG_MAKEPRI doesn't appear in
> <http://www.opengroup.org/onlinepubs/9699919799/>.
> Does LOG_MAKEPRI have any status in terms of standards?
>
> Would it be better for it to be removed or redefined to issue a
> preprocessor error?

It seems a bug.  MAKEPRI is shifting the facility argument << 3, but
all the facility macros are already shifted so that you can just or
them in.  I'd say MAKEPRI should not be shifting, but I'm not sure
where the macro is being used.

Reply via email to