From 64626895854bd38aff43f5c67b2960983f8b6e1a Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 22 Aug 2024 09:15:29 -0700 Subject: [PATCH] dmesg: Line buffering for stdout In one-shot "dump the log" mode, the buffering strategy doesn't matter too much. But when in "follow" mode (-w or -W), this means we won't necessarily dump new log message promptly -- we'll wait until we fill the stdout buffer (currently 4KiB). Line buffering means we'll print things proactively, as soon as we read them from kmsg or syslog. --- toys/lsb/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/lsb/dmesg.c b/toys/lsb/dmesg.c index a29961c9..29539af9 100644 --- a/toys/lsb/dmesg.c +++ b/toys/lsb/dmesg.c @@ -7,7 +7,7 @@ * Linux 6.0 celebrates the 10th anniversary of this being in "testing": * http://kernel.org/doc/Documentation/ABI/testing/dev-kmsg -USE_DMESG(NEWTOY(dmesg, "w(follow)W(follow-new)CSTtrs#<1n#c[!Ttr][!Cc][!SWw]", TOYFLAG_BIN)) +USE_DMESG(NEWTOY(dmesg, "w(follow)W(follow-new)CSTtrs#<1n#c[!Ttr][!Cc][!SWw]", TOYFLAG_BIN|TOYFLAG_LINEBUF)) config DMESG bool "dmesg" -- 2.39.2