{
if (errno == EINTR)
continue;
- error (0, errno, _("reading %s"), quote (src_name));
+ error (0, errno, _("error reading %s"), quote (src_name));
return false;
}
if (n_read == 0)
size_t n = n_read;
if (full_write (dest_fd, buf, n) != n)
{
- error (0, errno, _("writing %s"), quote (dst_name));
+ error (0, errno, _("error writing %s"), quote (dst_name));
return false;
}
close_src_and_dst_desc:
if (close (dest_desc) < 0)
{
- error (0, errno, _("closing %s"), quote (dst_name));
+ error (0, errno, _("failed to close %s"), quote (dst_name));
return_val = false;
}
close_src_desc:
if (close (source_desc) < 0)
{
- error (0, errno, _("closing %s"), quote (src_name));
+ error (0, errno, _("failed to close %s"), quote (src_name));
return_val = false;
}
if (err)
{
if (err != ENOENT)
- error (EXIT_FAILURE, err, _("accessing %s"), quote (file));
+ error (EXIT_FAILURE, err, _("failed to access %s"), quote (file));
*new_dst = true;
}
return is_a_dir;
{
struct stat st;
if (stat (optarg, &st) != 0)
- error (EXIT_FAILURE, errno, _("accessing %s"), quote (optarg));
+ error (EXIT_FAILURE, errno, _("failed to access %s"),
+ quote (optarg));
if (! S_ISDIR (st.st_mode))
error (EXIT_FAILURE, 0, _("target %s is not a directory"),
quote (optarg));
{
if (fdesc == STDIN_FILENO)
{
- error (0, errno, _("reading %s"), quote (file));
+ error (0, errno, _("error reading %s"), quote (file));
if (conversions_mask & C_NOERROR)
print_stats ();
}
if (nread < 0)
{
- error (0, errno, _("reading %s"), quote (input_file));
+ error (0, errno, _("error reading %s"), quote (input_file));
if (conversions_mask & C_NOERROR)
{
print_stats ();
w_bytes += nwritten;
if (nwritten != n_bytes_read)
{
- error (0, errno, _("writing %s"), quote (output_file));
+ error (0, errno, _("error writing %s"), quote (output_file));
return EXIT_FAILURE;
}
else if (n_bytes_read == input_blocksize)
w_partial++;
if (nwritten != oc)
{
- error (0, errno, _("writing %s"), quote (output_file));
+ error (0, errno, _("error writing %s"), quote (output_file));
return EXIT_FAILURE;
}
}
else
{
if (fd_reopen (STDIN_FILENO, input_file, O_RDONLY | input_flags, 0) < 0)
- error (EXIT_FAILURE, errno, _("opening %s"), quote (input_file));
+ error (EXIT_FAILURE, errno, _("failed to open %s"), quote (input_file));
}
offset = lseek (STDIN_FILENO, 0, SEEK_CUR);
|| fd_reopen (STDOUT_FILENO, output_file, O_RDWR | opts, perms) < 0)
&& (fd_reopen (STDOUT_FILENO, output_file, O_WRONLY | opts, perms)
< 0))
- error (EXIT_FAILURE, errno, _("opening %s"), quote (output_file));
+ error (EXIT_FAILURE, errno, _("failed to open %s"),
+ quote (output_file));
if (seek_records != 0 && !(conversions_mask & C_NOTRUNC))
{
ok = head (filename, fd, n_units, count_lines, elide_from_end);
if (!is_stdin && close (fd) != 0)
{
- error (0, errno, _("closing %s"), quote (filename));
+ error (0, errno, _("failed to close %s"), quote (filename));
return false;
}
return ok;
int err = (stat (file, &st) == 0 ? 0 : errno);
bool is_a_dir = !err && S_ISDIR (st.st_mode);
if (err && err != ENOENT)
- error (EXIT_FAILURE, err, _("accessing %s"), quote (file));
+ error (EXIT_FAILURE, err, _("failed to access %s"), quote (file));
if (is_a_dir < looks_like_a_dir)
error (EXIT_FAILURE, err, _("target %s is not a directory"), quote (file));
return is_a_dir;
{
struct stat st;
if (stat (optarg, &st) != 0)
- error (EXIT_FAILURE, errno, _("accessing %s"), quote (optarg));
+ error (EXIT_FAILURE, errno, _("failed to access %s"),
+ quote (optarg));
if (! S_ISDIR (st.st_mode))
error (EXIT_FAILURE, 0, _("target %s is not a directory"),
quote (optarg));
int err = (stat_result == 0 ? 0 : errno);
bool is_a_dir = !err && S_ISDIR (st.st_mode);
if (err && err != ENOENT)
- error (EXIT_FAILURE, err, _("accessing %s"), quote (file));
+ error (EXIT_FAILURE, err, _("failed to access %s"), quote (file));
if (is_a_dir < looks_like_a_dir)
error (EXIT_FAILURE, err, _("target %s is not a directory"), quote (file));
return is_a_dir;
: lstat (source, &source_stats))
!= 0)
{
- error (0, errno, _("accessing %s"), quote (source));
+ error (0, errno, _("failed to access %s"), quote (source));
return false;
}
dest_lstat_ok = (lstat (dest, &dest_stats) == 0);
if (!dest_lstat_ok && errno != ENOENT)
{
- error (0, errno, _("accessing %s"), quote (dest));
+ error (0, errno, _("failed to access %s"), quote (dest));
return false;
}
}
{
struct stat st;
if (stat (optarg, &st) != 0)
- error (EXIT_FAILURE, errno, _("accessing %s"), quote (optarg));
+ error (EXIT_FAILURE, errno, _("failed to access %s"),
+ quote (optarg));
if (! S_ISDIR (st.st_mode))
error (EXIT_FAILURE, 0, _("target %s is not a directory"),
quote (optarg));
int err = (stat (file, &st) == 0 ? 0 : errno);
bool is_a_dir = !err && S_ISDIR (st.st_mode);
if (err && err != ENOENT)
- error (EXIT_FAILURE, err, _("accessing %s"), quote (file));
+ error (EXIT_FAILURE, err, _("failed to access %s"), quote (file));
return is_a_dir;
}
{
struct stat st;
if (stat (optarg, &st) != 0)
- error (EXIT_FAILURE, errno, _("accessing %s"), quote (optarg));
+ error (EXIT_FAILURE, errno, _("failed to access %s"),
+ quote (optarg));
if (! S_ISDIR (st.st_mode))
error (EXIT_FAILURE, 0, _("target %s is not a directory"),
quote (optarg));
{
if (close (STDIN_FILENO) != 0)
{
- error (0, errno, _("closing %s"), quote (file));
+ error (0, errno, _("failed to close %s"), quote (file));
return false;
}
}
errors |= !do_ftruncate (fd, fname, size, rsize, rel_mode);
if (close (fd) != 0)
{
- error (0, errno, _("closing %s"), quote (fname));
+ error (0, errno, _("failed to close %s"), quote (fname));
errors = true;
}
}