summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-09-23 20:50:49 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-09-23 20:50:49 +0000
commit8e4680db2fd9a0ad8efaabea3d41f34b00eddf4f (patch)
treec839e7cca3a372b5becce38c1a2d564d25ea9555 /src
parent63b77aac44f5ed542439f4d7c71fdd6625bcc0f6 (diff)
downloadcoreutils-8e4680db2fd9a0ad8efaabea3d41f34b00eddf4f.tar.xz
(install_file_in_file): Be more conservative about the previous patch:
set time stamps on all non-regular files.
Diffstat (limited to 'src')
-rw-r--r--src/install.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/install.c b/src/install.c
index 1bdb0a724..116589a45 100644
--- a/src/install.c
+++ b/src/install.c
@@ -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;
}