Descriptio: logging to stderr output is slightly different from glibc (timestamp added) Index: b/usr/src/lib/libc/port/gen/syslog.c =================================================================== --- a/usr/src/lib/libc/port/gen/syslog.c +++ b/usr/src/lib/libc/port/gen/syslog.c @@ -338,9 +338,7 @@ vsyslog(int pri, const char *fmt, va_lis dat.buf = outline; /* output the message to the local logger */ - if ((putmsg(LogFile, &ctl, &dat, 0) >= 0) && syslogd_ok()) - return; - if (!(LogStat & LOG_CONS)) + if ((putmsg(LogFile, &ctl, &dat, 0) >= 0) && syslogd_ok() && !(LogStat & LOG_PERROR)) return; /* @@ -353,6 +351,15 @@ vsyslog(int pri, const char *fmt, va_lis clen = strlen(outline) + 1; + if (LogStat & LOG_PERROR) + { + outline[clen - 1] = '\n'; + (void) write(STDERR_FILENO, outline, clen); + } + + if (!(LogStat & LOG_CONS)) + return; + nowait = (LogStat & LOG_NOWAIT); pid = forkx(nowait? 0 : (FORK_NOSIGCHLD | FORK_WAITPID)); if (pid == -1) Index: b/usr/src/head/syslog.h =================================================================== --- a/usr/src/head/syslog.h +++ b/usr/src/head/syslog.h @@ -33,6 +33,10 @@ #include #include +#ifndef LOG_PERROR +#define LOG_PERROR 0x20 +#endif + #define LOG_PRI(p) ((p) & LOG_PRIMASK) #define LOG_MAKEPRI(fac, pri) ((fac) | (pri))