summaryrefslogtreecommitdiffstats
path: root/sys-utils/chcpu.c
diff options
context:
space:
mode:
authorKarel Zak2013-05-14 23:33:59 +0200
committerKarel Zak2013-05-14 23:33:59 +0200
commit69e74525bb3212944feebc8c2848317e04d95ec0 (patch)
treedd90bfb87238b77ea0b0ec0eb5f4613d8be40f2c /sys-utils/chcpu.c
parentsulogin: clean up error messages (diff)
downloadkernel-qcow2-util-linux-69e74525bb3212944feebc8c2848317e04d95ec0.tar.gz
kernel-qcow2-util-linux-69e74525bb3212944feebc8c2848317e04d95ec0.tar.xz
kernel-qcow2-util-linux-69e74525bb3212944feebc8c2848317e04d95ec0.zip
chcpu: clean up error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/chcpu.c')
-rw-r--r--sys-utils/chcpu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c
index da6f65887..1162888d5 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);
}