diff options
author | David Oberhollenzer <david.oberhollenzer@tele2.at> | 2018-08-22 18:20:34 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@tele2.at> | 2018-08-23 09:07:10 +0200 |
commit | 532f5e6819faadb394a0dfa6999ab80044ec7c69 (patch) | |
tree | 3befcc2c08565d7f3b92785a467a5ed4fe549aae /syslogd/logfile.c | |
parent | 73404a09d4f26522902a11b02f27896fa1a23d37 (diff) |
Normalize syslog message line endings
Most syslog messages have a line feed at the end, but some don't. This patch
removes trailing spaces from all syslog messages that have one and always adds
a line feed in the logging back end.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'syslogd/logfile.c')
-rw-r--r-- | syslogd/logfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/syslogd/logfile.c b/syslogd/logfile.c index ec82d0c..62e58f4 100644 --- a/syslogd/logfile.c +++ b/syslogd/logfile.c @@ -151,10 +151,10 @@ static int logfile_write(logfile_t *file, const syslog_msg_t *msg) if (fac_name == NULL) return -1; - ret = dprintf(file->fd, "[%s][%s][%s][%u] %s", timebuf, + ret = dprintf(file->fd, "[%s][%s][%s][%u] %s\n", timebuf, fac_name, lvl_str, msg->pid, msg->message); } else { - ret = dprintf(file->fd, "[%s][%s][%u] %s", timebuf, lvl_str, + ret = dprintf(file->fd, "[%s][%s][%u] %s\n", timebuf, lvl_str, msg->pid, msg->message); } |