From: Benno Schulenberg Date: Tue, 25 Mar 2025 10:42:58 +0000 (+0100) Subject: chmem: print warnings about failures always (not only with --verbose) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48675a7442000405910bec9e6a68305e4a67a93c;p=thirdparty%2Futil-linux.git chmem: print warnings about failures always (not only with --verbose) This makes the handling of errors the same as some 90 lines down. Signed-off-by: Benno Schulenberg --- diff --git a/sys-utils/chmem.c b/sys-utils/chmem.c index 4105d1969..5ff344fd3 100644 --- a/sys-utils/chmem.c +++ b/sys-utils/chmem.c @@ -146,12 +146,12 @@ static int chmem_size(struct chmem_desc *desc, int enable, int zone_id) idxtostr(desc, index, str, sizeof(str)); rc = ul_path_writef_string(desc->sysmem, onoff, "%s/state", name); - if (rc != 0 && desc->verbose) { + if (rc != 0) { if (enable) - fprintf(stdout, _("%s enable failed\n"), str); + warn(_("%s enable failed"), str); else - fprintf(stdout, _("%s disable failed\n"), str); - } else if (rc == 0 && desc->verbose) { + warn(_("%s disable failed"), str); + } else if (desc->verbose) { if (enable) fprintf(stdout, _("%s enabled\n"), str); else