summaryrefslogtreecommitdiffstats
path: root/mount
diff options
context:
space:
mode:
authorPetr Uzel2011-09-22 12:12:37 +0200
committerKarel Zak2011-09-27 15:46:07 +0200
commit960cf5737e58c03b0d29797c0d4bd3461f1fdeff (patch)
tree10cc302358d2ffa6673010b3e8cebbb924570ab6 /mount
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 'mount')
-rw-r--r--mount/fstab.c2
-rw-r--r--mount/lomount.c3
-rw-r--r--mount/mount.c7
-rw-r--r--mount/umount.c10
4 files changed, 9 insertions, 13 deletions
diff --git a/mount/fstab.c b/mount/fstab.c
index 6c0e89f30..078401ccc 100644
--- a/mount/fstab.c
+++ b/mount/fstab.c
@@ -1103,7 +1103,7 @@ main(int argc, char **argv)
nloops = atoi(argv[4]);
if (stat(filename, &st) < -1)
- die(EXIT_FAILURE, "%s: %s\n", filename, strerror(errno));
+ die(EXIT_FAILURE, "%s: %m\n", filename);
fprintf(stderr, "%05d (pid=%05d): START\n", id, pid);
diff --git a/mount/lomount.c b/mount/lomount.c
index 74a874929..ff99413e9 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -875,8 +875,7 @@ set_loop(const char *device, const char *file, unsigned long long offset,
if (errno == EBUSY) {
if (verbose)
- printf(_("ioctl LOOP_SET_FD failed: %s\n"),
- strerror(errno));
+ printf(_("ioctl LOOP_SET_FD failed: %m\n"));
rc = 2;
} else
perror("ioctl: LOOP_SET_FD");
diff --git a/mount/mount.c b/mount/mount.c
index d2ecb1de6..d74da2c74 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -781,10 +781,10 @@ check_special_mountprog(const char *spec, const char *node, const char *type, in
int i = 0;
if (setgid(getgid()) < 0)
- die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno));
+ die(EX_FAIL, _("mount: cannot set group id: %m"));
if (setuid(getuid()) < 0)
- die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno));
+ die(EX_FAIL, _("mount: cannot set user id: %m"));
oo = fix_opts_string (flags, extra_opts, NULL);
mountargs[i++] = mountprog; /* 1 */
@@ -1470,8 +1470,7 @@ cdrom_setspeed(const char *spec) {
_("mount: cannot open %s for setting speed"),
spec);
if (ioctl(cdrom, CDROM_SELECT_SPEED, speed) < 0)
- die(EX_FAIL, _("mount: cannot set speed: %s"),
- strerror(errno));
+ die(EX_FAIL, _("mount: cannot set speed: %m"));
close(cdrom);
}
}
diff --git a/mount/umount.c b/mount/umount.c
index 5000aa569..c7ebf7d3c 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -129,10 +129,10 @@ check_special_umountprog(const char *node,
int i = 0;
if(setgid(getgid()) < 0)
- die(EX_FAIL, _("umount: cannot set group id: %s"), strerror(errno));
+ die(EX_FAIL, _("umount: cannot set group id: %m"));
if(setuid(getuid()) < 0)
- die(EX_FAIL, _("umount: cannot set user id: %s"), strerror(errno));
+ die(EX_FAIL, _("umount: cannot set user id: %m"));
umountargs[i++] = umountprog;
umountargs[i++] = xstrdup(node);
@@ -244,12 +244,10 @@ static const char *chdir_to_parent(const char *node, char **resbuf)
}
if (chdir(parent) == -1)
- die (2, _("umount: failed to chdir to %s: %s"),
- parent, strerror(errno));
+ die (2, _("umount: failed to chdir to %s: %m"), parent);
if (!getcwd(buf, sizeof(buf)))
- die (2, _("umount: failed to obtain current directory: %s"),
- strerror(errno));
+ die (2, _("umount: failed to obtain current directory: %m"));
if (strcmp(buf, parent) != 0)
die (2, _("umount: mountpoint moved (%s -> %s)"), parent, buf);