]> 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>
Mon, 2 Nov 2015 09:19:03 +0000 (10:19 +0100)
commit2d3c38b557565d6a53017ea92f5fb35e6f8a26c8
tree459552995e31a0c9f50bcd704f4cb1b28cbdc94e
parent19dddd5561cab69f5dcf1d412c4abe0420b07b57
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