diff options
author | Karel Zak <kzak@redhat.com> | 2014-02-06 11:48:40 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2014-02-06 11:48:40 +0100 |
commit | 3938c08cd56a7c83ea387073c1404d0e864c9fa3 (patch) | |
tree | a20f2c4a0e25e1ac296a7bdc53b180399dacfd0f | |
parent | 663bf040611240d164f2464b4d892ecd2b02fa6f (diff) | |
download | util-linux-3938c08cd56a7c83ea387073c1404d0e864c9fa3.tar.gz |
dmesg: -w output not line-buffered
when writing to e.g. a pipe, output from dmesg -w can come many
minutes late due to buffering.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1060925
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | sys-utils/dmesg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index ec39612f..3ed0b1db 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1010,6 +1010,8 @@ static int init_kmsg(struct dmesg_control *ctl) if (!ctl->follow) mode |= O_NONBLOCK; + else + setlinebuf(stdout); ctl->kmsg = open("/dev/kmsg", mode); if (ctl->kmsg < 0) |