]> git.ipfire.org Git - thirdparty/util-linux.git/commit
logger: fix messages separation on UNIX socket
authorKarel Zak <kzak@redhat.com>
Tue, 6 Oct 2015 07:16:33 +0000 (09:16 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 6 Oct 2015 07:16:33 +0000 (09:16 +0200)
commitfc20393cdb5ed960fa4d6822c2fbf15fc191a6a0
tree69d562823a00b6179c748de2e3a7e7d9486cbc38
parentfa8945db4aa0526655655526c3ace8fafaf32f8e
logger: fix messages separation on UNIX socket

The function write_output() add additional \n after each message on
TYPE_TPC. This is required by syslog daemons, otherwise you will see
multiple log messages merged together in your log file, for example:

  Oct  6 09:01:40 ws kzak: AAA<14>Oct  6 09:01:40 kzak: BBB

for

  printf "AAA\nBBB\n" | logger -p info -u <any-socket>

Unfortunately, the connection initialization functions keep the
default ALL_TYPES as connection type and nowhere in the control struct
is info about the final real connection type. The problem is invisible
when you specify --tpc or --udp on logger command line.

Addresses: https://github.com/karelzak/util-linux/issues/225
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/logger.c