summaryrefslogtreecommitdiffstats
path: root/sys-utils/chcpu.c
diff options
context:
space:
mode:
authorPetr Uzel2011-09-22 12:12:37 +0200
committerKarel Zak2011-09-27 15:46:07 +0200
commit960cf5737e58c03b0d29797c0d4bd3461f1fdeff (patch)
tree10cc302358d2ffa6673010b3e8cebbb924570ab6 /sys-utils/chcpu.c
parentdocs: update TODO (diff)
downloadkernel-qcow2-util-linux-960cf5737e58c03b0d29797c0d4bd3461f1fdeff.tar.gz
kernel-qcow2-util-linux-960cf5737e58c03b0d29797c0d4bd3461f1fdeff.tar.xz
kernel-qcow2-util-linux-960cf5737e58c03b0d29797c0d4bd3461f1fdeff.zip
misc: use %m in format string instead of %s and strerror(errno)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Diffstat (limited to 'sys-utils/chcpu.c')
-rw-r--r--sys-utils/chcpu.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c
index 2cf015fb4..475c1cec6 100644
--- a/sys-utils/chcpu.c
+++ b/sys-utils/chcpu.c
@@ -96,8 +96,7 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable)
printf(_("CPU %d enable failed "
"(CPU is deconfigured)\n"), cpu);
else if (rc == -1)
- printf(_("CPU %d enable failed (%s)\n"), cpu,
- strerror(errno));
+ printf(_("CPU %d enable failed (%m)\n"), cpu);
else
printf(_("CPU %d enabled\n"), cpu);
} else {
@@ -108,8 +107,7 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable)
}
rc = path_writestr("0", _PATH_SYS_CPU "/cpu%d/online", cpu);
if (rc == -1)
- printf(_("CPU %d disable failed (%s)\n"), cpu,
- strerror(errno));
+ printf(_("CPU %d disable failed (%m)\n"), cpu);
else {
printf(_("CPU %d disabled\n"), cpu);
if (onlinecpus)
@@ -181,15 +179,13 @@ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure)
if (configure) {
rc = path_writestr("1", _PATH_SYS_CPU "/cpu%d/configure", cpu);
if (rc == -1)
- printf(_("CPU %d configure failed (%s)\n"), cpu,
- strerror(errno));
+ printf(_("CPU %d configure failed (%m)\n"), cpu);
else
printf(_("CPU %d configured\n"), cpu);
} else {
rc = path_writestr("0", _PATH_SYS_CPU "/cpu%d/configure", cpu);
if (rc == -1)
- printf(_("CPU %d deconfigure failed (%s)\n"), cpu,
- strerror(errno));
+ printf(_("CPU %d deconfigure failed (%m)\n"), cpu);
else
printf(_("CPU %d deconfigured\n"), cpu);
}