[PATCH] logger: always update header when writing stdin line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Earlier separate inputs got the same timestamp even when input arrival was
ensured to happen at different second.

$ (echo foo; sleep 1.1; echo bar) | logger -t baz --no-act -s
<13>Feb 23 19:21:08 baz: foo
<13>Feb 23 19:21:08 baz: bar

Addresses: http://bugs.debian.org/798239
Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 misc-utils/logger.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index e439266..105426c 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -949,6 +949,7 @@ static void logger_stdin(struct logger_ctl *ctl)
 			c = getchar();
 		}
 		buf[i] = '\0';
+		generate_syslog_header(ctl);
 
 		if (i > 0 || !ctl->skip_empty_lines)
 			write_output(ctl, buf);
-- 
2.7.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux