{
struct stat new_stats;
- if (lstat (file, &new_stats))
+ if (stat (file, &new_stats))
{
if (force_silent == 0)
error (0, errno, _("getting new attributes of %s"), quote (file));
return 0;
}
-#ifdef S_ISLNK
- if (S_ISLNK (new_stats.st_mode)
- && stat (file, &new_stats))
- {
- if (force_silent == 0)
- error (0, errno, _("getting new attributes of %s"), quote (file));
- return 0;
- }
-#endif
-
return old_mode != new_stats.st_mode;
}
int fail;
int saved_errno;
- if (lstat (file, &file_stats))
+ if (deref_symlink ? stat (file, &file_stats) : lstat (file, &file_stats))
{
if (force_silent == 0)
error (0, errno, _("getting attributes of %s"), quote (file));
return 1;
}
+
#ifdef S_ISLNK
if (S_ISLNK (file_stats.st_mode))
- {
- if (! deref_symlink)
- return 0;
- else
- if (stat (file, &file_stats))
- {
- if (force_silent == 0)
- error (0, errno, _("getting attributes of %s"), quote (file));
- return 1;
- }
- }
+ return 0;
#endif
newmode = mode_adjust (file_stats.st_mode, changes);