]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: error out instead of silently ignoring force_prefix
authorThomas Weißschuh <thomas@t-8ch.de>
Fri, 8 Dec 2023 17:10:34 +0000 (18:10 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Mon, 11 Dec 2023 11:03:44 +0000 (12:03 +0100)
When using the option with one of the input mechanisms the user has to
look at the source to figure out why nothing is happening.

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

index 79e1c1690a167684827d4a533426f2402c87fd90..4d995ab7f89bc83c4b7a7c4bb65708371ed0487e 100644 (file)
@@ -1641,9 +1641,8 @@ int main(int argc, char *argv[])
                            errx(EXIT_FAILURE, _("--raw can be used together with --level or "
                                 "--facility only when reading messages from /dev/kmsg"));
 
-               /* only kmsg supports multi-line messages */
                if (ctl.force_prefix && ctl.method != DMESG_METHOD_KMSG)
-                       ctl.force_prefix = 0;
+                       errx(EXIT_FAILURE, _("only kmsg supports multi-line messages"));
                if (ctl.pager)
                        pager_redirect();
                n = process_buffer(&ctl, &buf);