summaryrefslogtreecommitdiffstats
path: root/lib/path.c
diff options
context:
space:
mode:
authorBenno Schulenberg2013-10-08 17:04:22 +0200
committerKarel Zak2013-10-09 11:37:38 +0200
commit47481cbd01819a6f387f6a2537f8ff1e4449deb0 (patch)
tree6dfafa51f6b490e329021a3d3acd7b39e1acdfb6 /lib/path.c
parenttests: use 'btrfs' rather than 'btrfsctl' (diff)
downloadkernel-qcow2-util-linux-47481cbd01819a6f387f6a2537f8ff1e4449deb0.tar.gz
kernel-qcow2-util-linux-47481cbd01819a6f387f6a2537f8ff1e4449deb0.tar.xz
kernel-qcow2-util-linux-47481cbd01819a6f387f6a2537f8ff1e4449deb0.zip
textual: standardize some "cannot read" and "seek failed" error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Diffstat (limited to 'lib/path.c')
-rw-r--r--lib/path.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/path.c b/lib/path.c
index 7a68d9fe2..1f7e25806 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -97,7 +97,7 @@ path_read_str(char *result, size_t len, const char *path, ...)
va_end(ap);
if (!fgets(result, len, fd))
- err(EXIT_FAILURE, _("failed to read: %s"), pathbuf);
+ err(EXIT_FAILURE, _("cannot read %s"), pathbuf);
fclose(fd);
len = strlen(result);
@@ -118,7 +118,7 @@ path_read_s32(const char *path, ...)
if (fscanf(fd, "%d", &result) != 1) {
if (ferror(fd))
- err(EXIT_FAILURE, _("failed to read: %s"), pathbuf);
+ err(EXIT_FAILURE, _("cannot read %s"), pathbuf);
else
errx(EXIT_FAILURE, _("parse error: %s"), pathbuf);
}
@@ -139,7 +139,7 @@ path_read_u64(const char *path, ...)
if (fscanf(fd, "%"SCNu64, &result) != 1) {
if (ferror(fd))
- err(EXIT_FAILURE, _("failed to read: %s"), pathbuf);
+ err(EXIT_FAILURE, _("cannot read %s"), pathbuf);
else
errx(EXIT_FAILURE, _("parse error: %s"), pathbuf);
}
@@ -187,7 +187,7 @@ path_cpuparse(int maxcpus, int islist, const char *path, va_list ap)
fd = path_vfopen("r" UL_CLOEXECSTR, 1, path, ap);
if (!fgets(buf, len, fd))
- err(EXIT_FAILURE, _("failed to read: %s"), pathbuf);
+ err(EXIT_FAILURE, _("cannot read %s"), pathbuf);
fclose(fd);
len = strlen(buf);