summaryrefslogtreecommitdiffstats
path: root/disk-utils/raw.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 /disk-utils/raw.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 'disk-utils/raw.c')
-rw-r--r--disk-utils/raw.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/disk-utils/raw.c b/disk-utils/raw.c
index 4cb74ca6f..84a71ecd7 100644
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -142,8 +142,8 @@ int main(int argc, char *argv[])
err = stat(block_name, &statbuf);
if (err) {
fprintf (stderr,
- _("Cannot locate block device '%s' (%s)\n"),
- block_name, strerror(errno));
+ _("Cannot locate block device '%s' (%m)\n"),
+ block_name);
exit(2);
}
@@ -201,8 +201,8 @@ static int query(int minor_raw, const char *raw_name, int quiet)
err = stat(raw_name, &statbuf);
if (err) {
- fprintf (stderr, _("Cannot locate raw device '%s' (%s)\n"),
- raw_name, strerror(errno));
+ fprintf (stderr, _("Cannot locate raw device '%s' (%m)\n"),
+ raw_name);
exit(2);
}
@@ -227,8 +227,7 @@ static int query(int minor_raw, const char *raw_name, int quiet)
if (has_worked && errno == EINVAL)
return 0;
fprintf (stderr,
- _("Error querying raw device (%s)\n"),
- strerror(errno));
+ _("Error querying raw device (%m)\n"));
exit(3);
}
/* If one query has worked, mark that fact so that we don't
@@ -253,8 +252,7 @@ static int bind(int minor_raw, int block_major, int block_minor)
err = ioctl(master_fd, RAW_SETBIND, &rq);
if (err < 0) {
fprintf (stderr,
- _("Error setting raw device (%s)\n"),
- strerror(errno));
+ _("Error setting raw device (%m)\n"));
exit(3);
}
printf (_("%sraw%d: bound to major %d, minor %d\n"),