[Cmake-commits] CMake branch, master, updated. v2.8.1-1231-gc15ed32

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jun 3 12:48:11 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  c15ed3294c68cc819d9471c4ea41dc3d2a95aadd (commit)
      from  3ac3dea6f0eb1ce68b321020ecdd336b3db8a0fe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c15ed3294c68cc819d9471c4ea41dc3d2a95aadd
commit c15ed3294c68cc819d9471c4ea41dc3d2a95aadd
Author: Brad King <brad.king at kitware.com>
Date:   Thu Jun 3 12:46:11 2010 -0400

    KWSys: Avoid stat in CopyFileAlways (#10790)
    
    On Windows 7 the file size reported by 'stat' on a new file sometimes
    reports zero even though the real size is correct.  This causes our
    CopyFileAlways method to falsely detect copy failure.  Work around the
    problem by trusting the state of ofstream after writing the file.

diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index afc7240..a2e194a 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1924,22 +1924,10 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination,
   fin.close();
   fout.close();
 
-  // More checks.
-  struct stat statSource, statDestination;
-  statSource.st_size = 12345;
-  statDestination.st_size = 12345;
-  if(stat(source, &statSource) != 0)
-    {
-    return false;
-    }
-  else if(stat(destination, &statDestination) != 0)
+  if(!fout)
     {
     return false;
     }
-  else if(statSource.st_size != statDestination.st_size)
-    {
-   return false;
-    }
   if ( copyPermissions && perms )
     {
     if ( !SystemTools::SetPermissions(destination, perm) )

-----------------------------------------------------------------------

Summary of changes:
 Source/kwsys/SystemTools.cxx |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list