diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-11-19 03:41:38 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 22:27:34 -0700 |
commit | 90e84c81486d757f1eec263565e605c1df500e7c (patch) | |
tree | 031828c56fb75b43e3424e0a14ea55144aea219a /klibc | |
parent | e4ad54a302773d8b1c197e32fe67541f1b60518e (diff) |
[PATCH] let klibc add the trailing newline to syslog conditionally
We get an empty line after every debug print from libsysfs,
so don't add a second if we already have one.
Diffstat (limited to 'klibc')
-rw-r--r-- | klibc/klibc/syslog.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/klibc/klibc/syslog.c b/klibc/klibc/syslog.c index 592992ba6b..e9d84d9ddc 100644 --- a/klibc/klibc/syslog.c +++ b/klibc/klibc/syslog.c @@ -60,7 +60,8 @@ void vsyslog(int prio, const char *format, va_list ap) len += vsnprintf(buf+len, BUFLEN-len, format, ap); if ( len > BUFLEN-1 ) len = BUFLEN-1; - buf[len++] = '\n'; + if (buf[len-1] != '\n') + buf[len++] = '\n'; fd = __syslog_fd; if ( fd == -1 ) |