]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
textual: grammarize and harmonize the stat error message
authorBenno Schulenberg <bensberg@justemail.net>
Thu, 29 Jan 2015 20:21:48 +0000 (21:21 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Feb 2015 10:27:10 +0000 (11:27 +0100)
The message "stat failed %s" seems to say that stat() failed to
do something, or failed to pass a test, but of course it means
that the statting of something failed.  So say so.  Also make
two very similar messages equal to this one.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
21 files changed:
disk-utils/fdformat.c
disk-utils/fsck.cramfs.c
disk-utils/mkfs.bfs.c
disk-utils/mkfs.cramfs.c
disk-utils/mkfs.minix.c
disk-utils/mkswap.c
disk-utils/partx.c
login-utils/last.c
login-utils/utmpdump.c
misc-utils/namei.c
misc-utils/rename.c
sys-utils/blkdiscard.c
sys-utils/dmesg.c
sys-utils/fallocate.c
sys-utils/fsfreeze.c
sys-utils/fstrim.c
sys-utils/swapon.c
sys-utils/switch_root.c
term-utils/mesg.c
text-utils/more.c
text-utils/tailf.c

index ad9a86367842a876edb1703606bec343902396df..e7d43da8f6b10ee188a7e0f42695487815272901 100644 (file)
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
        if (argc < 1)
                usage(stderr);
        if (stat(argv[0], &st) < 0)
-               err(EXIT_FAILURE, _("stat failed %s"), argv[0]);
+               err(EXIT_FAILURE, _("stat of %s failed"), argv[0]);
        if (!S_ISBLK(st.st_mode))
                /* do not test major - perhaps this was an USB floppy */
                errx(EXIT_FAILURE, _("%s: not a block device"), argv[0]);
index 419b9acb500cb04054a22b584ac52b81721b7f21..0a375f12c1da6b1cfa5811a8dda3ef47b1cd3c42 100644 (file)
@@ -143,7 +143,7 @@ static void test_super(int *start, size_t * length)
 
        /* find the physical size of the file or block device */
        if (stat(filename, &st) < 0)
-               err(FSCK_EX_ERROR, _("stat failed %s"), filename);
+               err(FSCK_EX_ERROR, _("stat of %s failed"), filename);
 
        fd = open(filename, O_RDONLY);
        if (fd < 0)
index 98e4b050c928e45271662372159bce17ab7ca895..2a223646eda4111be58168648d257d41f0ae297d 100644 (file)
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
        device = argv[optind++];
 
        if (stat(device, &statbuf) < 0)
-               err(EXIT_FAILURE, _("stat failed %s"), device);
+               err(EXIT_FAILURE, _("stat of %s failed"), device);
 
        if (!S_ISBLK(statbuf.st_mode))
                errx(EXIT_FAILURE, _("%s is not a block special device"), device);
index 509b50b9d5c88ac24962eff2e8b75814e1a50397..5b64ad80a24544dffcf95ffde55c8056904729a2 100644 (file)
@@ -328,7 +328,7 @@ static unsigned int parse_directory(struct entry *root_entry, const char *name,
                memcpy(endpath, dirent->d_name, namelen + 1);
 
                if (lstat(path, &st) < 0) {
-                       warn(_("stat failed %s"), endpath);
+                       warn(_("stat of %s failed"), endpath);
                        warn_skip = 1;
                        continue;
                }
@@ -748,7 +748,7 @@ int main(int argc, char **argv)
                case 'i':
                        opt_image = optarg;
                        if (lstat(opt_image, &st) < 0)
-                               err(MKFS_EX_USAGE, _("stat failed %s"), opt_image);
+                               err(MKFS_EX_USAGE, _("stat of %s failed"), opt_image);
                        image_length = st.st_size; /* may be padded later */
                        fslen_ub += (image_length + 3); /* 3 is for padding */
                        break;
@@ -785,7 +785,7 @@ int main(int argc, char **argv)
                blksize = getpagesize();
 
        if (stat(dirname, &st) < 0)
-               err(MKFS_EX_USAGE, _("stat failed %s"), dirname);
+               err(MKFS_EX_USAGE, _("stat of %s failed"), dirname);
        fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
        if (fd < 0)
                err(MKFS_EX_USAGE, _("cannot open %s"), outfile);
index 81b7ae33783ef882bff8afdbecfc7126df274b61..c84aed2b360164ce762225248248b6e062b66ba8 100644 (file)
@@ -747,7 +747,7 @@ int main(int argc, char ** argv) {
                strcpy(tmp+2, ".badblocks");
        }
        if (stat(device_name, &statbuf) < 0)
-               err(MKFS_EX_ERROR, _("stat failed %s"), device_name);
+               err(MKFS_EX_ERROR, _("stat of %s failed"), device_name);
        if (S_ISBLK(statbuf.st_mode))
                DEV = open(device_name,O_RDWR | O_EXCL);
        else
index b22c73fffac1e9efddf850dec699dca75d1ceab7..c7166f7313d9b9623531f08688ba18e30939a1b7 100644 (file)
@@ -239,7 +239,7 @@ static void open_device(struct mkswap_control *ctl)
        assert(ctl->devname);
 
        if (stat(ctl->devname, &ctl->devstat) < 0)
-               err(EXIT_FAILURE, _("stat failed %s"), ctl->devname);
+               err(EXIT_FAILURE, _("stat of %s failed"), ctl->devname);
 
        if (S_ISBLK(ctl->devstat.st_mode))
                ctl->fd = open(ctl->devname, O_RDWR | O_EXCL);
index 1ba531590cd39d89039898cbc410cf086f06b6de..f21c388a7e6aa64394e32a582cde7dc96164cd98 100644 (file)
@@ -888,7 +888,7 @@ int main(int argc, char **argv)
                device = argv[optind];
 
                if (stat(device, &sb))
-                       err(EXIT_FAILURE, _("stat failed %s"), device);
+                       err(EXIT_FAILURE, _("stat of %s failed"), device);
 
                part_devno = sb.st_rdev;
 
index e646cabf59615c26f4bd00fde1ddf9683c85c97f..d6d8d9624668ae591d9471a61111305d17fa8f0b 100644 (file)
@@ -670,7 +670,7 @@ static void process_wtmp_file(const struct last_control *ctl)
                begintime = ut.UL_UT_TIME;
        else {
                if (fstat(fileno(fp), &st) != 0)
-                       err(EXIT_FAILURE, _("stat failed %s"), ctl->altv[ctl->alti]);
+                       err(EXIT_FAILURE, _("stat of %s failed"), ctl->altv[ctl->alti]);
                begintime = st.st_ctime;
                quit = 1;
        }
index 00baf31fb36243303d8e88cf850cdbaa72876592..03cf4a94a65791dd69e787766cca1b4de5cb6f4c 100644 (file)
@@ -126,7 +126,7 @@ static void roll_file(const char *filename, off_t *size, FILE *out)
                err(EXIT_FAILURE, _("cannot open %s"), filename);
 
        if (fstat(fileno(in), &st) == -1)
-               err(EXIT_FAILURE, _("%s: stat failed"), filename);
+               err(EXIT_FAILURE, _("stat of %s failed"), filename);
 
        if (st.st_size == *size)
                goto done;
index 3af0380d16882947c5b5aa3ac9d770bf2f4404d6..15bec99607a5d768c0e11da285d707223a2accf2 100644 (file)
@@ -228,7 +228,7 @@ dotdot_stat(const char *dirname, struct stat *st)
        memcpy(path + len, DOTDOTDIR, sizeof(DOTDOTDIR));
 
        if (stat(path, st))
-               err(EXIT_FAILURE, _("stat failed %s"), path);
+               err(EXIT_FAILURE, _("stat of %s failed"), path);
        free(path);
        return st;
 }
index 5ecf86c443cf88afb403b67de4be77e7c36eccf3..f9cc3a5d25292009845854ac1b9e20780b5d58f4 100644 (file)
@@ -60,7 +60,7 @@ static int do_symlink(char *from, char *to, char *s, int verbose)
        struct stat sb;
 
        if (lstat(s, &sb) == -1) {
-               warn(_("%s: lstat failed"), s);
+               warn(_("stat of %s failed"), s);
                return 2;
        }
        if (!S_ISLNK(sb.st_mode)) {
index e33f9b9d6fc4f621428fcd73e75486d58f79f70c..3ee0b5d07d505b09a08700fa6f9b65efcab1df06 100644 (file)
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
                err(EXIT_FAILURE, _("cannot open %s"), path);
 
        if (fstat(fd, &sb) == -1)
-               err(EXIT_FAILURE, _("stat failed %s"), path);
+               err(EXIT_FAILURE, _("stat of %s failed"), path);
        if (!S_ISBLK(sb.st_mode))
                errx(EXIT_FAILURE, _("%s: not a block device"), path);
 
index a3da2b2acab7028bcea6ed2150a1346e533d4907..8360fa3116c8176984467e8c53fa88b2ed696d7a 100644 (file)
@@ -519,7 +519,7 @@ static ssize_t mmap_file_buffer(struct dmesg_control *ctl, char **buf)
        if (fd < 0)
                err(EXIT_FAILURE, _("cannot open %s"), ctl->filename);
        if (fstat(fd, &st))
-               err(EXIT_FAILURE, _("stat failed %s"), ctl->filename);
+               err(EXIT_FAILURE, _("stat of %s failed"), ctl->filename);
 
        *buf = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
        if (*buf == MAP_FAILED)
index 84b06b9609ec3f853d840b867a529f5e2d09919f..d7e591cd8d4b47753f222449d0ac000850e33307 100644 (file)
@@ -195,7 +195,7 @@ static void dig_holes(int fd, off_t off, off_t len)
 #endif
 
        if (fstat(fd, &st) != 0)
-               err(EXIT_FAILURE, _("stat failed %s"), filename);
+               err(EXIT_FAILURE, _("stat of %s failed"), filename);
 
        bufsz = st.st_blksize;
 
index d8b0a684cd0cbb2087ff34a38862b0f9156f3ee1..d4d5bd3df7d389a70289a60304d47b9a6506a74a 100644 (file)
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
                err(EXIT_FAILURE, _("cannot open %s"), path);
 
        if (fstat(fd, &sb) == -1) {
-               warn(_("stat failed %s"), path);
+               warn(_("stat of %s failed"), path);
                goto done;
        }
 
index fca74825fc140d9617eb19c5c668be16682796eb..847b81924962a21d91301fbaacd435617c75ec8f 100644 (file)
@@ -73,7 +73,7 @@ static int fstrim_filesystem(const char *path, struct fstrim_range *rangetpl,
                return -1;
        }
        if (fstat(fd, &sb) == -1) {
-               warn(_("stat failed %s"), path);
+               warn(_("stat of %s failed"), path);
                return -1;
        }
        if (!S_ISDIR(sb.st_mode)) {
index bcceb7c69fc98f48de173991a489c8968376697c..645a01d423ab0f957145dcab85c8839cf4c05ca7 100644 (file)
@@ -479,7 +479,7 @@ static int swapon_checks(const char *special)
        int permMask;
 
        if (stat(special, &st) < 0) {
-               warn(_("stat failed %s"), special);
+               warn(_("stat of %s failed"), special);
                goto err;
        }
 
index be23fd809e1b3045a52188bcf2c1e9a3ff716cec..dc55a6d080188958a2db5696fe0002614e8c3625 100644 (file)
@@ -90,7 +90,7 @@ static int recursiveRemove(int fd)
                        struct stat sb;
 
                        if (fstatat(dfd, d->d_name, &sb, AT_SYMLINK_NOFOLLOW)) {
-                               warn(_("stat failed %s"), d->d_name);
+                               warn(_("stat of %s failed"), d->d_name);
                                continue;
                        }
 
@@ -130,7 +130,7 @@ static int switchroot(const char *newroot)
        struct stat newroot_stat, sb;
 
        if (stat(newroot, &newroot_stat) != 0) {
-               warn(_("stat failed %s"), newroot);
+               warn(_("stat of %s failed"), newroot);
                return -1;
        }
 
index a3892871cf317eff9191d4083784e361c8ee7cc8..3cb1d24e6dfcc0169cdd8baba3064a1f8d2a591d 100644 (file)
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
                err(MESG_EXIT_FAILURE, _("ttyname failed"));
 
        if (stat(tty, &sb) < 0)
-               err(MESG_EXIT_FAILURE, _("stat failed %s"), tty);
+               err(MESG_EXIT_FAILURE, _("stat of %s failed"), tty);
 
        if (!*argv) {
                if (sb.st_mode & (S_IWGRP | S_IWOTH)) {
index 94b04550690da0b989f3781aae298b9fe5475d81..4602cba97a55322b8ed0318b24dd65e2073a341b 100644 (file)
@@ -595,7 +595,7 @@ FILE *checkf(register char *fs, int *clearfirst)
                fflush(stdout);
                if (clreol)
                        cleareol();
-               warn(_("stat failed %s"), fs);
+               warn(_("stat of %s failed"), fs);
                return ((FILE *)NULL);
        }
        if ((stbuf.st_mode & S_IFMT) == S_IFDIR) {
index 6adb05037a61785c5b1c445052b294e78e53834d..38df99f6f564c02479bcb1c41090e0d2bd2c5328 100644 (file)
@@ -98,7 +98,7 @@ roll_file(const char *filename, off_t *size)
                err(EXIT_FAILURE, _("cannot open %s"), filename);
 
        if (fstat(fd, &st) == -1)
-               err(EXIT_FAILURE, _("stat failed %s"), filename);
+               err(EXIT_FAILURE, _("stat of %s failed"), filename);
 
        if (st.st_size == *size) {
                close(fd);
@@ -278,7 +278,7 @@ int main(int argc, char **argv)
        filename = argv[optind];
 
        if (stat(filename, &st) != 0)
-               err(EXIT_FAILURE, _("stat failed %s"), filename);
+               err(EXIT_FAILURE, _("stat of %s failed"), filename);
 
        size = st.st_size;;
        tailf(filename, lines);