From: Thomas Weißschuh Date: Sun, 10 Mar 2024 09:43:20 +0000 (+0100) Subject: dmesg: print object closing brace while waiting for next message X-Git-Tag: v2.42-start~489 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5740148a20be4ac84884c342199d90553c90f04d;p=thirdparty%2Futil-linux.git dmesg: print object closing brace while waiting for next message Allow incremental parsers to process the full object as it is written by dmesg. Closes #2833 Signed-off-by: Thomas Weißschuh --- diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 25c674be3..e73cddf5e 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1344,10 +1344,13 @@ full_output: done: free(mesg_copy); - if (ctl->json) + if (ctl->json) { ul_jsonwrt_object_close(&ctl->jfmt); - else + if (ctl->follow) + ul_jsonwrt_flush(&ctl->jfmt); + } else { putchar('\n'); + } } /*