From: Karel Zak Date: Tue, 14 May 2013 21:33:59 +0000 (+0200) Subject: chcpu: clean up error messages X-Git-Tag: v2.24-rc1~551 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69e74525bb3212944feebc8c2848317e04d95ec0;p=thirdparty%2Futil-linux.git chcpu: clean up error messages Signed-off-by: Karel Zak --- diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c index da6f65887b..1162888d53 100644 --- a/sys-utils/chcpu.c +++ b/sys-utils/chcpu.c @@ -97,10 +97,10 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable) if (enable) { rc = path_write_str("1", _PATH_SYS_CPU "/cpu%d/online", cpu); if ((rc == -1) && (configured == 0)) - printf(_("CPU %d enable failed " - "(CPU is deconfigured)\n"), cpu); + warnx(_("CPU %d enable failed " + "(CPU is deconfigured)"), cpu); else if (rc == -1) - printf(_("CPU %d enable failed (%m)\n"), cpu); + warn(_("CPU %d enable failed"), cpu); else printf(_("CPU %d enabled\n"), cpu); } else { @@ -111,7 +111,7 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable) } rc = path_write_str("0", _PATH_SYS_CPU "/cpu%d/online", cpu); if (rc == -1) - printf(_("CPU %d disable failed (%m)\n"), cpu); + warn(_("CPU %d disable failed"), cpu); else { printf(_("CPU %d disabled\n"), cpu); if (onlinecpus) @@ -183,13 +183,13 @@ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure) if (configure) { rc = path_write_str("1", _PATH_SYS_CPU "/cpu%d/configure", cpu); if (rc == -1) - printf(_("CPU %d configure failed (%m)\n"), cpu); + warn(_("CPU %d configure failed"), cpu); else printf(_("CPU %d configured\n"), cpu); } else { rc = path_write_str("0", _PATH_SYS_CPU "/cpu%d/configure", cpu); if (rc == -1) - printf(_("CPU %d deconfigure failed (%m)\n"), cpu); + warn(_("CPU %d deconfigure failed"), cpu); else printf(_("CPU %d deconfigured\n"), cpu); }