summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-12-04 10:06:11 +0100
committerJim Meyering <jim@meyering.net>2006-12-04 10:06:11 +0100
commit8406e92795b8cfce52651ec663aece6b451740aa (patch)
tree56d95a8ae1905e9d2c798e71228f91a8abdb2adb /src
parent1ea616697a37c235a4b135a543969efe1f7e2834 (diff)
downloadcoreutils-8406e92795b8cfce52651ec663aece6b451740aa.tar.xz
install.c: Preserve time stamps before changing owner or file mode bits,
for consistency with other coreutils programs.
Diffstat (limited to 'src')
-rw-r--r--src/install.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/install.c b/src/install.c
index 1ccc7749c..a5d832f86 100644
--- a/src/install.c
+++ b/src/install.c
@@ -459,11 +459,10 @@ install_file_in_file (const char *from, const char *to,
return false;
if (strip_files)
strip (to);
- if (! change_attributes (to))
+ if (x->preserve_timestamps && (strip_files || ! S_ISREG (from_sb.st_mode))
+ && ! change_timestamps (&from_sb, to))
return false;
- if (x->preserve_timestamps && (strip_files || ! S_ISREG (from_sb.st_mode)))
- return change_timestamps (&from_sb, to);
- return true;
+ return change_attributes (to);
}
/* Copy file FROM into directory TO_DIR, keeping its same name,