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")),
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"))))
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;
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)¶m) < 0)
err(EXIT_FAILURE, _("Could not determine current format type"));
* /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?"));
}
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;
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);
}
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();
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);
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);
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;
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);
fd = open(devname, O_RDWR);
if (fd < 0) {
- warn(_("%s: failed to open"), devname);
+ warn(_("cannot open %s"), devname);
goto err;
}
#ifdef HAVE_LIBUUID
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;
}
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;
}
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;
}
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 */
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);
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 */
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;
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;
}
fd = open(p, flags);
if (fd == -1)
- err(EXIT_FAILURE, _("error: cannot open %s"), p);
+ err(EXIT_FAILURE, _("cannot open %s"), p);
return fd;
}
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;
(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;
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;
}
*/
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) {
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);
}
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);
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);
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"));
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))
f = fopen(tabfile, "r");
if (!f) {
- warn(_("%s: open failed"), tabfile);
+ warn(_("cannot open %s"), tabfile);
goto done;
}
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)
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);
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);
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;
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;
}
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);
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);
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);
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;
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;
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 */
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;
}
"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;
}
"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;
}
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;
}
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
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);
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;
}
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)
fd = open(devname, O_WRONLY);
if (fd == -1) {
- warn(_("%s: open failed"), devname);
+ warn(_("cannot open %s"), devname);
return -1;
}
fd = open(special, O_RDONLY);
if (fd == -1) {
- warn(_("%s: open failed"), special);
+ warn(_("cannot open %s"), special);
goto err;
}
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;
}
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':
die_if_link(fname);
}
if ((fscript = fopen(fname, aflg ? "a" : "w")) == NULL) {
- warn(_("open failed: %s"), fname);
+ warn(_("cannot open %s"), fname);
fail();
}
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);
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');
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)) {
save = fopen(p, "wb");
if (save == NULL) {
cmd.count = errno;
- mesg(_("Cannot open "));
+ mesg(_("cannot open "));
mesg(p);
mesg(": ");
mesg(strerror(cmd.count));
do {
if (*argv) {
if ((fp = fopen(*argv, "r")) == NULL) {
- warn(_("%s: open failed"), *argv );
+ warn(_("cannot open %s"), *argv );
rval = EXIT_FAILURE;
++argv;
continue;
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;
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);
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);