]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
translation: unify file open error messages
authorSami Kerola <kerolasa@iki.fi>
Sun, 15 Jul 2012 08:39:57 +0000 (10:39 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Jul 2012 16:18:22 +0000 (18:18 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
41 files changed:
disk-utils/addpart.c
disk-utils/delpart.c
disk-utils/fdformat.c
disk-utils/fsck.c
disk-utils/fsck.cramfs.c
disk-utils/fsck.minix.c
disk-utils/isosize.c
disk-utils/mkfs.cramfs.c
disk-utils/mkfs.minix.c
disk-utils/partx.c
disk-utils/swaplabel.c
fdisks/cfdisk.c
fdisks/fdisk.c
lib/at.c
lib/path.c
login-utils/islocal.c
login-utils/last.c
login-utils/sulogin.c
login-utils/utmpdump.c
login-utils/vipw.c
misc-utils/findmnt.c
misc-utils/mcookie.c
sys-utils/dmesg.c
sys-utils/eject.c
sys-utils/fallocate.c
sys-utils/fsfreeze.c
sys-utils/fstrim.c
sys-utils/hwclock-cmos.c
sys-utils/hwclock-rtc.c
sys-utils/hwclock.c
sys-utils/losetup.c
sys-utils/rtcwake.c
sys-utils/swapon.c
sys-utils/wdctl.c
term-utils/script.c
term-utils/scriptreplay.c
term-utils/wall.c
text-utils/pg.c
text-utils/rev.c
text-utils/tailf.c
text-utils/ul.c

index 0d814bf3eea4e1ed13460782a93bc5cc4356c2bb..c0f25a539e26750621d980b06b0d34dc10aebdb0 100644 (file)
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
                usage(stderr);
 
        if ((fd = open(argv[1], O_RDONLY)) < 0)
-               err(EXIT_FAILURE, _("%s: open failed"), argv[1]);
+               err(EXIT_FAILURE, _("cannot open %s"), argv[1]);
 
        if (partx_add_partition(fd,
                        strtou32_or_err(argv[2], _("invalid partition number argument")),
index 79925db89b213d720733beb8d3866067fff39e3e..e940e3bed4d1f2d78dd540d19c883e40e7e7be1a 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
 
 
        if ((fd = open(argv[1], O_RDONLY)) < 0)
-               err(EXIT_FAILURE, _("%s: open failed"), argv[1]);
+               err(EXIT_FAILURE, _("cannot open %s"), argv[1]);
 
        if (partx_del_partition(fd,
                        strtou32_or_err(argv[2], _("invalid partition number argument"))))
index 97fd4e8d6ddd19bb13bcd5f59044c8545767441f..e937a8ed51c8f5681474c5881ef3e9672b8e4040 100644 (file)
@@ -59,7 +59,7 @@ static void verify_disk(char *name)
        printf(_("Verifying ... "));
        fflush(stdout);
        if ((fd = open(name, O_RDONLY)) < 0)
-               err(EXIT_FAILURE, _("cannot open file %s"), name);
+               err(EXIT_FAILURE, _("cannot open %s"), name);
        for (cyl = 0; cyl < param.track; cyl++) {
                int read_bytes;
 
@@ -152,7 +152,7 @@ int main(int argc, char **argv)
 
        ctrl = open(argv[0], O_WRONLY);
        if (ctrl < 0)
-               err(EXIT_FAILURE, _("cannot open file %s"), argv[0]);
+               err(EXIT_FAILURE, _("cannot open %s"), argv[0]);
        if (ioctl(ctrl, FDGETPRM, (long)&param) < 0)
                err(EXIT_FAILURE, _("Could not determine current format type"));
 
index 46646a99b8b3112743aad62ab60e34f5c419816a..71263a27361e97f272ffe0f1220f112fe812c13f 100644 (file)
@@ -1344,7 +1344,7 @@ static void parse_argv(int argc, char *argv[])
                                 * /proc/partitions isn't found.
                                 */
                                if (access(_PATH_PROC_PARTITIONS, R_OK) < 0) {
-                                       warn(_("couldn't open %s"),
+                                       warn(_("cannot open %s"),
                                                _PATH_PROC_PARTITIONS);
                                        errx(FSCK_EX_ERROR, _("Is /proc mounted?"));
                                }
index ac378307e277905f89ed83a114dc0f5e6a47ff55..d64e2bed92eed4bdf5a6f87e36b355f32bc204b3 100644 (file)
@@ -143,7 +143,7 @@ static void test_super(int *start, size_t * length)
 
        fd = open(filename, O_RDONLY);
        if (fd < 0)
-               err(FSCK_EX_ERROR, _("open failed: %s"), filename);
+               err(FSCK_EX_ERROR, _("cannot open %s"), filename);
 
        if (S_ISBLK(st.st_mode)) {
                unsigned long long bytes;
@@ -495,7 +495,7 @@ static void do_file(char *path, struct cramfs_inode *i)
        if (opt_extract) {
                fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, i->mode);
                if (fd < 0)
-                       err(FSCK_EX_ERROR, _("open failed: %s"), path);
+                       err(FSCK_EX_ERROR, _("cannot open %s"), path);
        }
        if (i->size)
                do_uncompress(path, fd, offset, i->size);
index 5e56e832dca748c750fe9de73a3dd090926ed4dd..f24a9f215095bd0afbbacf9694b4355ec7105fb2 100644 (file)
@@ -1302,7 +1302,7 @@ main(int argc, char **argv) {
        }
        IN = open(device_name, repair ? O_RDWR : O_RDONLY);
        if (IN < 0)
-               die(_("unable to open '%s': %s"), device_name, strerror(errno));
+               die(_("cannot open %s: %s"), device_name, strerror(errno));
        for (count = 0; count < 3; count++)
                sync();
        read_superblock();
index 4ba34d550f9a6b2064cb39e0d97a57b0509ccd33..e5defae29e0cfd7143f6fa921e372e059ad1be6c 100644 (file)
@@ -123,7 +123,7 @@ static void isosize(char *filenamep, int xflag, long divisor)
        struct iso_primary_descriptor ipd;
 
        if ((fd = open(filenamep, O_RDONLY)) < 0)
-               err(EXIT_FAILURE, _("failed to open %s"), filenamep);
+               err(EXIT_FAILURE, _("cannot open %s"), filenamep);
 
        if (lseek(fd, 16 << 11, 0) == (off_t) - 1)
                err(EXIT_FAILURE, _("seek error on %s"), filenamep);
index 44d7740839354935829160837a48c758c4854d24..f504a32360be6d601e23b9f2995c52f34c7c1fde 100644 (file)
@@ -657,7 +657,7 @@ static unsigned int write_file(char *file, char *base, unsigned int offset)
 
        fd = open(file, O_RDONLY);
        if (fd < 0)
-               err(MKFS_EX_ERROR, _("cannot open file %s"), file);
+               err(MKFS_EX_ERROR, _("cannot open %s"), file);
        buf = mmap(NULL, image_length, PROT_READ, MAP_PRIVATE, fd, 0);
        memcpy(base + offset, buf, image_length);
        munmap(buf, image_length);
index a1b5162fafdb11dd6b7e7623cfaef372fb5362b4..49626bf2a75eca20923ece5f0fc5a49b72667c47 100644 (file)
@@ -759,7 +759,7 @@ int main(int argc, char ** argv) {
                DEV = open(device_name,O_RDWR);
 
        if (DEV<0)
-               err(MKFS_EX_ERROR, _("%s: open failed"), device_name);
+               err(MKFS_EX_ERROR, _("cannot open %s"), device_name);
 
        if (S_ISBLK(statbuf.st_mode)) {
                int sectorsize;
index a971a7ea8e7fd6010a775ecbe73970249c32874f..69c559dead9a4ef5cc4478776fffe4b0295e6c38 100644 (file)
@@ -827,7 +827,7 @@ int main(int argc, char **argv)
                        errx(EXIT_FAILURE, _("%s: not a block device"), wholedisk);
        }
        if ((fd = open(wholedisk, O_RDONLY)) == -1)
-               err(EXIT_FAILURE, _("%s: open failed"), wholedisk);
+               err(EXIT_FAILURE, _("cannot open %s"), wholedisk);
 
        if (what == ACT_DELETE)
                rc = del_parts(fd, wholedisk, disk_devno, lower, upper);
index 44b1cb368e26a54739edd0e242a38a98758f6e6e..3e3e78b16eaa72d00e617a9d24d621a39c463574 100644 (file)
@@ -102,7 +102,7 @@ static int change_info(const char *devname, const char *label, const char *uuid)
 
        fd = open(devname, O_RDWR);
        if (fd < 0) {
-               warn(_("%s: failed to open"), devname);
+               warn(_("cannot open %s"), devname);
                goto err;
        }
 #ifdef HAVE_LIBUUID
index 967a1034c658fd8f233b64c33fb64a28f6a44f0c..0ceed33ba735dc380c7b8cb42a0c5df058cea071 100644 (file)
@@ -1820,7 +1820,7 @@ print_raw_table(void) {
            if ((fp = fopen(fname, "w")) == NULL) {
                char errstr[LINE_LENGTH];
                snprintf(errstr, sizeof(errstr),
-                        _("Cannot open file '%s'"), fname);
+                        _("cannot open %s"), fname);
                print_warning(errstr);
                return;
            }
@@ -1938,7 +1938,7 @@ print_p_info(void) {
        if (to_file) {
            if ((fp = fopen(fname, "w")) == NULL) {
                char errstr[LINE_LENGTH];
-               snprintf(errstr, LINE_LENGTH, _("Cannot open file '%s'"), fname);
+               snprintf(errstr, LINE_LENGTH, _("cannot open %s"), fname);
                print_warning(errstr);
                return;
            }
@@ -2022,7 +2022,7 @@ print_part_table(void) {
        if (to_file) {
            if ((fp = fopen(fname, "w")) == NULL) {
                char errstr[LINE_LENGTH];
-               snprintf(errstr, LINE_LENGTH, _("Cannot open file '%s'"), fname);
+               snprintf(errstr, LINE_LENGTH, _("cannot open %s"), fname);
                print_warning(errstr);
                return;
            }
index 3fede9591b423311a9ce63cb5af26d2b28a98eae..99174faef937985466518d7943f94c8a7d451c38 100644 (file)
@@ -1783,7 +1783,7 @@ static void print_partition_table_from_option(char *device, unsigned long sector
 
        struct fdisk_context *cxt = fdisk_new_context_from_filename(device, 1); /* read-only */
        if (!cxt)
-               err(EXIT_FAILURE, _("unable to open %s"), device);
+               err(EXIT_FAILURE, _("cannot open %s"), device);
        if (sector_size)  /* passed -b option, override autodiscovery */
                cxt->phy_sector_size = cxt->sector_size = sector_size;
        /* passed CHS option(s), override autodiscovery */
@@ -1970,7 +1970,7 @@ static sector_t get_dev_blocks(char *dev)
        sector_t size;
 
        if ((fd = open(dev, O_RDONLY)) < 0)
-               err(EXIT_FAILURE, _("unable to open %s"), dev);
+               err(EXIT_FAILURE, _("cannot open %s"), dev);
        if (blkdev_get_sectors(fd, &size) == -1) {
                close(fd);
                err(EXIT_FAILURE, _("BLKGETSIZE ioctl failed on %s"), dev);
@@ -2085,7 +2085,7 @@ int main(int argc, char **argv)
 
        cxt = fdisk_new_context_from_filename(argv[optind], 0);
        if (!cxt)
-               err(EXIT_FAILURE, _("unable to open %s"), argv[optind]);
+               err(EXIT_FAILURE, _("cannot open %s"), argv[optind]);
        if (sector_size)        /* passed -b option, override autodiscovery */
                cxt->phy_sector_size = cxt->sector_size = sector_size;
        /* passed CHS option(s), override autodiscovery */
index 062a10f1b3155d1b204c69f5538c5f07308ed6b2..bbce5163023723f683042f1e5788f85d55b0062d 100644 (file)
--- a/lib/at.c
+++ b/lib/at.c
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
 
        dir = opendir(dirname);
        if (!dir)
-               err(EXIT_FAILURE, "%s: open failed", dirname);
+               err(EXIT_FAILURE, "cannot open %s", dirname);
 
        while ((d = readdir(dir))) {
                struct stat st;
index 0d4d39135da4027b876d46e6c4208618bb0f2a9f..8437c0220f54037cdea9b6a93ef888aa659f9162 100644 (file)
@@ -55,7 +55,7 @@ path_vfopen(const char *mode, int exit_on_error, const char *path, va_list ap)
 
        f = fopen(p, mode);
        if (!f && exit_on_error)
-               err(EXIT_FAILURE, _("error: cannot open %s"), p);
+               err(EXIT_FAILURE, _("cannot open %s"), p);
        return f;
 }
 
@@ -67,7 +67,7 @@ path_vopen(int flags, const char *path, va_list ap)
 
        fd = open(p, flags);
        if (fd == -1)
-               err(EXIT_FAILURE, _("error: cannot open %s"), p);
+               err(EXIT_FAILURE, _("cannot open %s"), p);
        return fd;
 }
 
index e23ca44e0bc1a8e8a068cd9df10b691bbc7cd6d4..1f8516618e709ef880dbd7da22a0834f81a96e10 100644 (file)
@@ -84,8 +84,7 @@ int is_local(const char *user)
        int rv;
        if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0) {
                perror(_PATH_PASSWD);
-               fprintf(stderr, _("Failed to open %s for reading, exiting."),
-                       _PATH_PASSWD);
+               fprintf(stderr, _("cannot open %s"), _PATH_PASSWD);
                exit(1);
        } else {
                return rv;
index 1b1bee1190b2beb7f3aaf8083b05e46fbe17f928..77a890abe848fe9a6c44d8abfbf37748ef45b376 100644 (file)
@@ -242,7 +242,7 @@ wtmp(void) {
        (void)signal(SIGQUIT, onintr);
 
        if ((fd = open(file,O_RDONLY)) < 0)
-               err(EXIT_FAILURE, _("%s: open failed"), file);
+               err(EXIT_FAILURE, _("cannot open %s"), file);
 
        fstat(fd, &st);
        utl_len = st.st_size;
index 7750ad9577d48efcfb7bab5a4a4daa768104aa3c..7ac493be2f3d9cb6f9e3c7bdd3ce7fccb6e8ae8a 100644 (file)
@@ -213,7 +213,7 @@ static struct passwd *getrootpwent(int try_manually)
        pwd.pw_gid = 0;
 
        if ((fp = fopen(_PATH_PASSWD, "r")) == NULL) {
-               warn(_("%s: open failed"), _PATH_PASSWD);
+               warn(_("cannot open %s"), _PATH_PASSWD);
                return &pwd;
        }
 
@@ -251,7 +251,7 @@ static struct passwd *getrootpwent(int try_manually)
         */
        strcpy(pwd.pw_passwd, "");
        if ((fp = fopen(_PATH_SHADOW_PASSWD, "r")) == NULL) {
-               warn(_("%s: open failed"), _PATH_PASSWD);
+               warn(_("cannot open %s"), _PATH_PASSWD);
                return &pwd;
        }
        while ((p = fgets(sline, 256, fp)) != NULL) {
@@ -521,7 +521,7 @@ int main(int argc, char **argv)
        if (tty || (tty = getenv("CONSOLE"))) {
 
                if ((fd = open(tty, O_RDWR)) < 0) {
-                       warn(_("%s: open failed"), tty);
+                       warn(_("cannot open %s"), tty);
                        fd = dup(0);
                }
 
@@ -556,7 +556,7 @@ int main(int argc, char **argv)
                                if (fd > 2)
                                        close(fd);
                                if ((fd = open(tty, O_RDWR|O_NOCTTY)) < 0)
-                                       warn(_("%s: open failed"), tty);
+                                       warn(_("cannot open %s"), tty);
                                else {
                                        ioctl(0, TIOCSCTTY, (char *)1);
                                        tcsetpgrp(fd, ppgrp);
index d907e02074b1765e0c66bfaa3cad7e2d3e69ffa1..cb850af13cacdf33c600f3005a230f0c9d2c6140 100644 (file)
@@ -115,7 +115,7 @@ static void roll_file(const char *filename, off_t *size)
        off_t pos;
 
        if (!(fp = fopen(filename, "r")))
-               err(EXIT_FAILURE, _("%s: open failed"), filename);
+               err(EXIT_FAILURE, _("cannot open %s"), filename);
 
        if (fstat(fileno(fp), &st) == -1)
                err(EXIT_FAILURE, _("%s: stat failed"), filename);
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
                filename = argv[optind];
                fp = fopen(filename, "r");
                if (!fp)
-                       err(EXIT_FAILURE, _("%s: open failed"), filename);
+                       err(EXIT_FAILURE, _("cannot open %s"), filename);
        } else {
                if (follow)
                        errx(EXIT_FAILURE, _("following standard input is unsupported"));
index a5982813bf943cf23107fa51bb075e1ece6bf864..33771127add7018293eb41e69171df898d120260 100644 (file)
@@ -264,7 +264,7 @@ static void edit_file(int is_shadow)
 
        passwd_file = open(orig_file, O_RDONLY, 0);
        if (passwd_file < 0)
-               err(EXIT_FAILURE, "%s: %s", _("cannot open file"), orig_file);
+               err(EXIT_FAILURE, _("cannot open %s"), orig_file);
        tmp_fd = pw_tmpfile(passwd_file);
 
        if (fstat(fileno(tmp_fd), &begin))
index 094734d72d75f4ba1c789af0fc757a58e9b8ae73..6df2f061223666aacf156353accd7bab9b6cabbd 100644 (file)
@@ -893,7 +893,7 @@ static int poll_table(struct libmnt_table *tb, const char *tabfile,
 
        f = fopen(tabfile, "r");
        if (!f) {
-               warn(_("%s: open failed"), tabfile);
+               warn(_("cannot open %s"), tabfile);
                goto done;
        }
 
index b10f5c6fa5592c029f67c8eafaff05ba367fedba..b7b1762dc5ce7d6e94c537c317e334ff95a45135 100644 (file)
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
                        fd = open(file, O_RDONLY);
 
                if (fd < 0) {
-                       warn(_("Could not open %s"), file);
+                       warn(_("cannot open %s"), file);
                } else {
                        count = hash_file(&ctx, fd);
                        if (verbose)
@@ -178,7 +178,7 @@ int main(int argc, char **argv)
                        if (rngs[i].minlength && r >= rngs[i].minlength)
                                break;
                } else if (verbose)
-                       warn(_("Could not open %s"), rngs[i].path);
+                       warn(_("cannot open %s"), rngs[i].path);
        }
 
        MD5Final(digest, &ctx);
index 2aa904cab086359116793e5c4303d528d3a452cc..033d2e5e805e6d14eed9d2867297b5c9322531a0 100644 (file)
@@ -359,7 +359,7 @@ static ssize_t read_file_buffer(struct dmesg_control *ctl,
        int fd = open(filename, O_RDONLY);
 
        if (fd < 0)
-               err(EXIT_FAILURE, _("cannot open: %s"), filename);
+               err(EXIT_FAILURE, _("cannot open %s"), filename);
        if (fstat(fd, &st))
                err(EXIT_FAILURE, _("stat failed %s"), filename);
 
index f621b062e7d40d964aa1252e41ee323c8d041f79..fdc3402c28144c0fdf510b3393f9b0a65be0381d 100644 (file)
@@ -497,7 +497,7 @@ static int read_speed(const char *devname)
 
        f = fopen(_PATH_PROC_CDROMINFO, "r");
        if (!f)
-               err(EXIT_FAILURE, _("%s: open failed"), _PATH_PROC_CDROMINFO);
+               err(EXIT_FAILURE, _("cannot open %s"), _PATH_PROC_CDROMINFO);
 
        name = rindex(devname, '/') + 1;
 
@@ -689,7 +689,7 @@ static int open_device(const char *name)
        if (fd < 0)
                fd = open(name, O_RDONLY|O_NONBLOCK);
        if (fd == -1)
-               err(EXIT_FAILURE, _("%s: open failed"), name);
+               err(EXIT_FAILURE, _("cannot open %s"), name);
        return fd;
 }
 
index adfaa70f799a95dbf74130c3e150ab184b951e3f..ff0f9e6e1d72589e93fbc222601e2d5f431c7eec 100644 (file)
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
 
        fd = open(fname, O_WRONLY|O_CREAT, 0644);
        if (fd < 0)
-               err(EXIT_FAILURE, _("%s: open failed"), fname);
+               err(EXIT_FAILURE, _("cannot open %s"), fname);
 
 #ifdef HAVE_FALLOCATE
        error = fallocate(fd, mode, offset, length);
index 1585abb765c137555f76b6724d433325758207da..7161442474d8778213baa555c7ee19109106776c 100644 (file)
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
 
        fd = open(path, O_RDONLY);
        if (fd < 0)
-               err(EXIT_FAILURE, _("%s: open failed"), path);
+               err(EXIT_FAILURE, _("cannot open %s"), path);
 
        if (fstat(fd, &sb) == -1) {
                warn(_("stat failed %s"), path);
index d7633b07a2f58e01a9ebf6c46be940c5d7835263..332601df70fa94a343328b744c771b1b4a3f5c22 100644 (file)
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
 
        fd = open(path, O_RDONLY);
        if (fd < 0)
-               err(EXIT_FAILURE, _("%s: open failed"), path);
+               err(EXIT_FAILURE, _("cannot open %s"), path);
 
        if (ioctl(fd, FITRIM, &range))
                err(EXIT_FAILURE, _("%s: FITRIM ioctl failed"), path);
index 366d934fbdda01fe5b7b6299b40260ac4357a57e..85452b5c240c134af64c5f634b764ae22f181e1c 100644 (file)
@@ -634,7 +634,7 @@ static int get_permissions_cmos(void)
 
        if (use_dev_port) {
                if ((dev_port_fd = open("/dev/port", O_RDWR)) < 0) {
-                       warn(_("Cannot open /dev/port"));
+                       warn(_("cannot open %s"), "/dev/port");
                        rc = 1;
                } else
                        rc = 0;
index 62adc49d7d6abf8be8903545bdcc9bec000ad525..33809419088f8d8871cba1e36523dfbff67331e5 100644 (file)
@@ -159,7 +159,7 @@ static int open_rtc_or_exit(void)
        int rtc_fd = open_rtc();
 
        if (rtc_fd < 0) {
-               warn(_("open() of %s failed"), rtc_dev_name);
+               warn(_("cannot open %s"), rtc_dev_name);
                hwclock_exit(EX_OSFILE);
        }
        return rtc_fd;
@@ -253,7 +253,7 @@ static int synchronize_to_clock_tick_rtc(void)
 
        rtc_fd = open_rtc();
        if (rtc_fd == -1) {
-               warn(_("open() of %s failed"), rtc_dev_name);
+               warn(_("cannot open %s"), rtc_dev_name);
                ret = 1;
        } else {
                int rc;         /* Return code from ioctl */
@@ -417,7 +417,7 @@ struct clock_ops *probe_for_rtc_clock(void)
        if (rtc_fd >= 0)
                return &rtc;
        if (debug)
-               warn(_("Open of %s failed"), rtc_dev_name);
+               warn(_("cannot open %s"), rtc_dev_name);
        return NULL;
 }
 
@@ -438,7 +438,7 @@ int get_epoch_rtc(unsigned long *epoch_p, int silent)
                                       "file %s.  This file does not exist on this system."),
                                      rtc_dev_name);
                        else
-                               warn(_("Unable to open %s"), rtc_dev_name);
+                               warn(_("cannot open %s"), rtc_dev_name);
                }
                return 1;
        }
@@ -485,7 +485,7 @@ int set_epoch_rtc(unsigned long epoch)
                               "file %s.  This file does not exist on this system."),
                              rtc_dev_name);
                else
-                       warn(_("Unable to open %s"), rtc_dev_name);
+                       warn(_("cannot open %s"), rtc_dev_name);
                return 1;
        }
 
index 332f78cd2f2638ade526ef522c00c67ab5067427..b4a388fd1461886dd29a5921788f7e9ae8b018cb 100644 (file)
@@ -281,7 +281,7 @@ static int read_adjtime(struct adjtime *adjtime_p)
 
        adjfile = fopen(adj_file_name, "r");    /* open file for reading */
        if (adjfile == NULL) {
-               warn("cannot open file %s", adj_file_name);
+               warn("cannot open %s", adj_file_name);
                return EX_OSFILE;
        }
 
index 48af8ebcac1e12f48e1349519df29f6783b4e5de..24d3d3cf1093b42483931171aebc7444c1aa6b0f 100644 (file)
@@ -117,7 +117,7 @@ static int set_capacity(struct loopdev_cxt *lc)
        int fd = loopcxt_get_fd(lc);
 
        if (fd < 0)
-               warn(_("%s: open failed"), loopcxt_get_device(lc));
+               warn(_("cannot open %s"), loopcxt_get_device(lc));
        else if (ioctl(fd, LOOP_SET_CAPACITY) != 0)
                warnx(_("%s: set capacity failed"), loopcxt_get_device(lc));
        else
index 321f8d5f33be29acc806e78b77570de7cd221c2a..0e16bd388e22e5c8453a40088adec86c98ec9203 100644 (file)
@@ -116,7 +116,7 @@ static int is_wakeup_enabled(const char *devname)
        snprintf(buf, sizeof buf, RTC_PATH, devname + strlen("/dev/"));
        f = fopen(buf, "r");
        if (!f) {
-               warn(_("open failed: %s"), buf);
+               warn(_("cannot open %s"), buf);
                return 0;
        }
        s = fgets(buf, sizeof buf, f);
@@ -276,7 +276,7 @@ static void suspend_system(const char *suspend)
        FILE    *f = fopen(SYS_POWER_STATE_PATH, "w");
 
        if (!f) {
-               warn(_("open failed: %s"), SYS_POWER_STATE_PATH);
+               warn(_("cannot open %s"), SYS_POWER_STATE_PATH);
                return;
        }
 
@@ -514,7 +514,7 @@ int main(int argc, char **argv)
        fd = open(devname, O_RDONLY);
 #endif
        if (fd < 0)
-               err(EXIT_FAILURE, _("open failed: %s"), devname);
+               err(EXIT_FAILURE, _("cannot open %s"), devname);
 
        /* relative or absolute alarm time, normalized to time_t */
        if (get_basetimes(fd) < 0)
index aec7d2e5ea87a30bd562c6a0b7ee824ec3afaf7f..c9cabc140f5535ac804cac63a34055fe9ad1e770 100644 (file)
@@ -307,7 +307,7 @@ static int swap_rewrite_signature(const char *devname, unsigned int pagesize)
 
        fd = open(devname, O_WRONLY);
        if (fd == -1) {
-               warn(_("%s: open failed"), devname);
+               warn(_("cannot open %s"), devname);
                return -1;
        }
 
@@ -474,7 +474,7 @@ static int swapon_checks(const char *special)
 
        fd = open(special, O_RDONLY);
        if (fd == -1) {
-               warn(_("%s: open failed"), special);
+               warn(_("cannot open %s"), special);
                goto err;
        }
 
index 7d31d411a9e20938ad622cdb0eb71bd210825c9d..ebe55b41ac7cec214bc74c47dfd436dffeb953c9 100644 (file)
@@ -282,7 +282,7 @@ static int read_watchdog(struct wdinfo *wd)
                if (errno == EBUSY)
                        warnx(_("%s: watchdog already in use, terminating."),
                                        wd->device);
-               warn(_("%s: open failed"), wd->device);
+               warn(_("cannot open %s"), wd->device);
                return -1;
        }
 
index 5935b85166ed3b7f918071a3d09d44cd86769170..8d7ab65f00a3409a5b2a3f0563c49dd330a97465 100644 (file)
@@ -205,7 +205,7 @@ main(int argc, char **argv) {
                case 't':
                        if (optarg)
                                if ((timingfd = fopen(optarg, "w")) == NULL)
-                                       err(EXIT_FAILURE, _("cannot open timing file %s"), optarg);
+                                       err(EXIT_FAILURE, _("cannot open %s"), optarg);
                        tflg = 1;
                        break;
                case 'V':
@@ -230,7 +230,7 @@ main(int argc, char **argv) {
                die_if_link(fname);
        }
        if ((fscript = fopen(fname, aflg ? "a" : "w")) == NULL) {
-               warn(_("open failed: %s"), fname);
+               warn(_("cannot open %s"), fname);
                fail();
        }
 
@@ -557,7 +557,7 @@ getslave(void) {
        line[strlen("/dev/")] = 't';
        slave = open(line, O_RDWR);
        if (slave < 0) {
-               warn(_("open failed: %s"), line);
+               warn(_("cannot open %s"), line);
                fail();
        }
        tcsetattr(slave, TCSANOW, &tt);
index 91c55c3c7a961607a3989f0307e5300ec0f13ab4..9aa4783c05defc09192fb277abc2ba29b81f176c 100644 (file)
@@ -194,10 +194,10 @@ main(int argc, char *argv[])
 
        tfile = fopen(tname, "r");
        if (!tfile)
-               err(EXIT_FAILURE, _("cannot open timing file %s"), tname);
+               err(EXIT_FAILURE, _("cannot open %s"), tname);
        sfile = fopen(sname, "r");
        if (!sfile)
-               err(EXIT_FAILURE, _("cannot open typescript file %s"), sname);
+               err(EXIT_FAILURE, _("cannot open %s"), sname);
 
        /* ignore the first typescript line */
        while((c = fgetc(sfile)) != EOF && c != '\n');
index 1f44be4c7efb0b5d2a9b25b40f0a154307765d57..30324aa85704171a1a51bbe9ef933803f69a79dc 100644 (file)
@@ -244,7 +244,7 @@ makemsg(char *fname, size_t *mbufsize, int print_banner)
                             fname);
 
                if (!freopen(fname, "r", stdin))
-                       err(EXIT_FAILURE, _("cannot open file %s"), fname);
+                       err(EXIT_FAILURE, _("cannot open %s"), fname);
        }
 
        while (fgets(lbuf, line_max, stdin)) {
index 0bd8279810c27de5927bd152d4bdd9462f669d05..9ade866ed8e519364aba8a16586379e052977c2c 100644 (file)
@@ -1310,7 +1310,7 @@ found_bw:
                                save = fopen(p, "wb");
                                if (save == NULL) {
                                        cmd.count = errno;
-                                       mesg(_("Cannot open "));
+                                       mesg(_("cannot open "));
                                        mesg(p);
                                        mesg(": ");
                                        mesg(strerror(cmd.count));
index 3c64c12d144d528d5cf6482627cefaefd60f6de0..a44f9c6ebc760187f74e6655f8c6e159c64fad97 100644 (file)
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
        do {
                if (*argv) {
                        if ((fp = fopen(*argv, "r")) == NULL) {
-                               warn(_("%s: open failed"), *argv );
+                               warn(_("cannot open %s"), *argv );
                                rval = EXIT_FAILURE;
                                ++argv;
                                continue;
index 9e77a2f0936f75fc500da1b091eb4e44746c227e..e27a14d3ea1c5188f5ed89924c4a032fa9dacd88 100644 (file)
@@ -59,7 +59,7 @@ tailf(const char *filename, int lines)
        int  i;
 
        if (!(str = fopen(filename, "r")))
-               err(EXIT_FAILURE, _("cannot open \"%s\" for read"), filename);
+               err(EXIT_FAILURE, _("cannot open %s"), filename);
 
        buf = xmalloc((lines ? lines : 1) * BUFSIZ);
        p = buf;
@@ -96,7 +96,7 @@ roll_file(const char *filename, off_t *size)
 
        fd = open(filename, O_RDONLY);
        if (fd < 0)
-               err(EXIT_FAILURE, _("cannot open \"%s\" for read"), filename);
+               err(EXIT_FAILURE, _("cannot open %s"), filename);
 
        if (fstat(fd, &st) == -1)
                err(EXIT_FAILURE, _("stat failed %s"), filename);
index d08ca9a11a7c28c85987087451bc9272d8ccaa67..80bc7a12e5aae9f23acef5cbefb7c5792e7fdb90 100644 (file)
@@ -228,7 +228,7 @@ int main(int argc, char **argv)
                for (; optind < argc; optind++) {
                        f = fopen(argv[optind],"r");
                        if (!f)
-                               err(EXIT_FAILURE, _("%s: open failed"),
+                               err(EXIT_FAILURE, _("cannot open %s"),
                                    argv[optind]);
                        filter(f);
                        fclose(f);