Explorar o código

BUG: Attempt to fix CopyFile problem using flush before check for success.

Brad King %!s(int64=23) %!d(string=hai) anos
pai
achega
c96c3c382f
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      Source/cmSystemTools.cxx

+ 6 - 1
Source/cmSystemTools.cxx

@@ -1246,7 +1246,12 @@ void cmSystemTools::cmCopyFile(const char* source,
       fout.write(buffer, fin.gcount());
       }
     }
-
+  
+  // Make sure the operating system has finished writing the file
+  // before closing it.  This will ensure the file is finished before
+  // the check below.
+  fout.flush();
+  
   fin.close();
   fout.close();