]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chmem: do not word a configuration failure as an instruction to the user
authorBenno Schulenberg <bensberg@telfort.nl>
Tue, 9 Dec 2025 15:02:21 +0000 (16:02 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Dec 2025 10:46:30 +0000 (11:46 +0100)
When the current machine does not support configuring/deconfiguring
memory, simply report that it cannot be done, instead of seemingly
telling the user to skip the configuring/deconfiguring.

Also, there is no need to mention `chmem` in the message: mentioning
just the recommended option (-e or -d) is enough.  Also, consistently
terminate all four messages with a period.

This improves upon commit ab2e709600 ("chmem: improve messages").

CC: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
sys-utils/chmem.c

index 6ec66bb6b3467514e051df48edbd122075fd5343..dcec888d1f543926df36128c44e49a0d559ad779 100644 (file)
@@ -325,10 +325,10 @@ static int chmem_config_size(struct chmem_desc *desc, int configure)
        if (!desc->have_memconfig) {
                if (configure)
                        fprintf(stdout,
-                               _("Skip configuration. Use chmem -e instead.\n"));
+                               _("Cannot configure. Use -e instead.\n"));
                else
                        fprintf(stdout,
-                               _("Skip deconfiguration. Use chmem -d instead\n"));
+                               _("Cannot deconfigure. Use -d instead.\n"));
                return -1;
        }
        size = desc->size;
@@ -363,10 +363,10 @@ static int chmem_config_range(struct chmem_desc *desc, int configure)
        if (!desc->have_memconfig) {
                if (configure)
                        fprintf(stdout,
-                               _("Skip configuration. Use chmem -e instead.\n"));
+                               _("Cannot configure. Use -e instead.\n"));
                else
                        fprintf(stdout,
-                               _("Skip deconfiguration. Use chmem -d instead\n"));
+                               _("Cannot deconfigure. Use -d instead.\n"));
                return -1;
        }
        todo = desc->end - desc->start + 1;