summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrgad Shaneh <orgads@gmail.com>2016-07-31 09:18:22 +0300
committerOrgad Shaneh <orgads@gmail.com>2016-11-16 09:08:27 +0200
commit7a9d7128d87d1572a0b7f99ff7b19d704395c8db (patch)
treea58993e58b288c2679f046b47f62e0b3b738b171
parent62f16de2d17af4ac1f3df4622b7bec850b60820a (diff)
downloadopenssl-new-7a9d7128d87d1572a0b7f99ff7b19d704395c8db.tar.gz
mklink: Do not needlessly overwrite linked files...
... on systems with symlinks. Creating or overwriting a symlink sets the file ctime to the current time. This causes needless rebuilds because the time of all the headers is changed, and apparently make considers the link's time rather than the time of the target. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1370)
-rwxr-xr-xutil/mklink.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/mklink.pl b/util/mklink.pl
index 2df0453a17..a937606ea5 100755
--- a/util/mklink.pl
+++ b/util/mklink.pl
@@ -55,8 +55,10 @@ if ($^O eq "msys") { $symlink_exists=0 };
foreach $file (@files) {
my $err = "";
if ($symlink_exists) {
- unlink "$from/$file";
- symlink("$to/$file", "$from/$file") or $err = " [$!]";
+ if (!-l "$from/$file") {
+ unlink "$from/$file";
+ symlink("$to/$file", "$from/$file") or $err = " [$!]";
+ }
} elsif (-d "$from" && (!-f "$from/$file" || ((stat("$file"))[9] > (stat("$from/$file"))[9]))) {
unlink "$from/$file";
open (OLD, "<$file") or die "Can't open $file: $!";