]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: print object closing brace while waiting for next message
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 10 Mar 2024 09:43:20 +0000 (10:43 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Mar 2024 13:04:44 +0000 (14:04 +0100)
Allow incremental parsers to process the full object as it is written by
dmesg.

Closes #2833

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
sys-utils/dmesg.c

index 25c674be3b6aa1128c3aefc5eafda4181665ab8c..e73cddf5e064b3a73bd2fd19e6c4e7ddbf8763c8 100644 (file)
@@ -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');
+       }
 }
 
 /*