diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-02-16 01:23:04 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-02-16 01:23:04 +0400 |
commit | 5cb86029b197bdd1b31bc80a288290772477f189 (patch) | |
tree | 305df192ff71edf0bedd86fd092244bb8bc694c5 /libc | |
parent | 51612fe5ea4cb81a8972deb0b926aaee1b233123 (diff) | |
download | illumos-packaging-5cb86029b197bdd1b31bc80a288290772477f189.tar.gz |
Implemented LOG_PERROR - logging to stderr
Diffstat (limited to 'libc')
-rw-r--r-- | libc/debian/changelog | 1 | ||||
-rw-r--r-- | libc/debian/patches/series | 1 | ||||
-rw-r--r-- | libc/debian/patches/syslog-LOG_PERROR.patch | 48 |
3 files changed, 50 insertions, 0 deletions
diff --git a/libc/debian/changelog b/libc/debian/changelog index b246f7c..7bd1e41 100644 --- a/libc/debian/changelog +++ b/libc/debian/changelog @@ -7,6 +7,7 @@ libc (2.10+16) UNRELEASED; urgency=medium * Fixed vhangup: it returns int, not void * Implemented prioritynames and facilitynames in syslog.h [syslog- names.patch] + * Implemented LOG_PERROR - logging to stderr [syslog-LOG_PERROR.patch] -- Igor Pashev <pashev.igor@gmail.com> Wed, 12 Feb 2014 14:59:10 +0400 diff --git a/libc/debian/patches/series b/libc/debian/patches/series index a7ab315..3a09090 100644 --- a/libc/debian/patches/series +++ b/libc/debian/patches/series @@ -109,3 +109,4 @@ unistd-add-environ.patch define-getdomainname.patch libc-vhangup-returns-int.patch syslog-names.patch +syslog-LOG_PERROR.patch diff --git a/libc/debian/patches/syslog-LOG_PERROR.patch b/libc/debian/patches/syslog-LOG_PERROR.patch new file mode 100644 index 0000000..99d15b0 --- /dev/null +++ b/libc/debian/patches/syslog-LOG_PERROR.patch @@ -0,0 +1,48 @@ +Descriptio: logging to stderr + output is slightly different from glibc (timestamp added) +Index: libc/usr/src/lib/libc/port/gen/syslog.c +=================================================================== +--- libc.orig/usr/src/lib/libc/port/gen/syslog.c 2014-02-16 00:22:46.507682463 +0400 ++++ libc/usr/src/lib/libc/port/gen/syslog.c 2014-02-16 01:19:57.042136105 +0400 +@@ -338,9 +338,7 @@ + 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 @@ + + 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: libc/usr/src/head/syslog.h +=================================================================== +--- libc.orig/usr/src/head/syslog.h 2014-02-16 00:02:42.476650797 +0400 ++++ libc/usr/src/head/syslog.h 2014-02-16 00:49:19.900083616 +0400 +@@ -32,6 +32,10 @@ + #include <sys/syslog.h> + #include <sys/va_list.h> + ++#ifndef LOG_PERROR ++#define LOG_PERROR 0x20 ++#endif ++ + #define LOG_PRI(p) ((p) & LOG_PRIMASK) + #define LOG_MAKEPRI(fac, pri) ((fac) | (pri)) + |