and use that later. Otherwise, errno itself could be clobbered before used.
{
int fail;
int symlink_changed = 1;
+ int saved_errno;
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
{
{
fail = chown (file, newuser, newgroup);
}
+ saved_errno = errno;
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
{
if (fail)
{
if (force_silent == 0)
- error (0, errno, "%s", file);
+ error (0, saved_errno, "%s", file);
errors = 1;
}
}