diff options
author | Brad King <brad.king@kitware.com> | 2004-11-03 12:23:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-11-03 12:23:18 (GMT) |
commit | d46d8df0edfcfac46390319db8213601a5cd4260 (patch) | |
tree | 86f2c559e3983463981ea30e59fa25193207dfb2 /Source/cmLocalUnixMakefileGenerator2.cxx | |
parent | 3050e231b35c7b8b3e1dfcc37275dddb3b5d7445 (diff) | |
download | CMake-d46d8df0edfcfac46390319db8213601a5cd4260.zip CMake-d46d8df0edfcfac46390319db8213601a5cd4260.tar.gz CMake-d46d8df0edfcfac46390319db8213601a5cd4260.tar.bz2 |
ENH: Re-implemented cmGeneratedFileStream to look like a real stream and replace the destination file atomically. This will avoid problems with the process being terminated while generating a file.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator2.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator2.cxx | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx index bf1733e..d29f545 100644 --- a/Source/cmLocalUnixMakefileGenerator2.cxx +++ b/Source/cmLocalUnixMakefileGenerator2.cxx @@ -237,12 +237,9 @@ cmLocalUnixMakefileGenerator2 // Open the rule file. This should be copy-if-different because the // rules may depend on this file itself. std::string ruleFileNameFull = this->ConvertToFullPath(ruleFileName); - cmGeneratedFileStream ruleFile(ruleFileNameFull.c_str()); - std::ostream& ruleFileStream = ruleFile.GetStream(); + cmGeneratedFileStream ruleFileStream(ruleFileNameFull.c_str(), true); if(!ruleFileStream) { - // TODO: Produce error message that accounts for generated stream - // .tmp. return; } this->WriteDisclaimer(ruleFileStream); @@ -354,12 +351,9 @@ cmLocalUnixMakefileGenerator2 std::string ruleFileName = obj; ruleFileName += ".make"; std::string ruleFileNameFull = this->ConvertToFullPath(ruleFileName); - cmGeneratedFileStream ruleFile(ruleFileNameFull.c_str()); - std::ostream& ruleFileStream = ruleFile.GetStream(); + cmGeneratedFileStream ruleFileStream(ruleFileNameFull.c_str(), true); if(!ruleFileStream) { - // TODO: Produce error message that accounts for generated stream - // .tmp. return; } this->WriteDisclaimer(ruleFileStream); @@ -532,12 +526,9 @@ cmLocalUnixMakefileGenerator2 // Open the rule file. This should be copy-if-different because the // rules may depend on this file itself. std::string ruleFileNameFull = this->ConvertToFullPath(ruleFileName); - cmGeneratedFileStream ruleFile(ruleFileNameFull.c_str()); - std::ostream& ruleFileStream = ruleFile.GetStream(); + cmGeneratedFileStream ruleFileStream(ruleFileNameFull.c_str(), true); if(!ruleFileStream) { - // TODO: Produce error message that accounts for generated stream - // .tmp. return; } this->WriteDisclaimer(ruleFileStream); |