summaryrefslogtreecommitdiffstats
path: root/Source/cmOutputRequiredFilesCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-10-10 14:48:10 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-10-10 14:48:10 (GMT)
commitada0f98e91ef52a067c380681d0e35fffc2ec6b5 (patch)
tree295de93f492ee26be9f845555ffad5ea202206c0 /Source/cmOutputRequiredFilesCommand.cxx
parent4e6e9e83356bdab287e543ebd65dbb6a883d3463 (diff)
downloadCMake-ada0f98e91ef52a067c380681d0e35fffc2ec6b5.zip
CMake-ada0f98e91ef52a067c380681d0e35fffc2ec6b5.tar.gz
CMake-ada0f98e91ef52a067c380681d0e35fffc2ec6b5.tar.bz2
BUG: fix for 5071, report error if output file can not be opened
Diffstat (limited to 'Source/cmOutputRequiredFilesCommand.cxx')
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 98dfabc..831601d 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -199,6 +199,13 @@ bool cmOutputRequiredFilesCommand
{
// write them out
FILE *fout = fopen(this->OutputFile.c_str(),"w");
+ if(!fout)
+ {
+ std::string err = "Can not open output file: ";
+ err += this->OutputFile;
+ this->SetError(err.c_str());
+ return false;
+ }
std::set<cmDependInformation const*> visited;
this->ListDependencies(info,fout, &visited);
fclose(fout);