From 5740148a20be4ac84884c342199d90553c90f04d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 10 Mar 2024 10:43:20 +0100 Subject: [PATCH] dmesg: print object closing brace while waiting for next message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Allow incremental parsers to process the full object as it is written by dmesg. Closes #2833 Signed-off-by: Thomas Weißschuh --- sys-utils/dmesg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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'); + } } /* -- 2.47.3