mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
(install_file_in_file): Be more conservative about the previous patch:
set time stamps on all non-regular files.
This commit is contained in:
1 parent
63b77aac44
commit
8e4680db2f
1 file changed
+2
-2
+2
-2
@@ -440,7 +440,7 @@ install_file_in_file (const char *from, const char *to,
|
||||
const struct cp_options *x)
|
||||
{
|
||||
struct stat from_sb;
|
||||
if (strip_files && x->preserve_timestamps && stat (from, &from_sb) != 0)
|
||||
if (x->preserve_timestamps && stat (from, &from_sb) != 0)
|
||||
{
|
||||
error (0, errno, _("cannot stat %s"), quote (from));
|
||||
return false;
|
||||
@@ -451,7 +451,7 @@ install_file_in_file (const char *from, const char *to,
|
||||
strip (to);
|
||||
if (! change_attributes (to))
|
||||
return false;
|
||||
if (strip_files && x->preserve_timestamps)
|
||||
if (x->preserve_timestamps && (strip_files || ! S_ISREG (from_sb.st_mode)))
|
||||
return change_timestamps (&from_sb, to);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user