summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-11-19 19:40:47 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-11-19 19:40:47 (GMT)
commit76fca308d3e04bc33cb8d03a8d10737e875791be (patch)
tree540e928eb23a25bddce446b20c038e6137a563a6
parentfd30c82a19a9424d477742f6a9c24e9e41ca4471 (diff)
downloadCMake-76fca308d3e04bc33cb8d03a8d10737e875791be.zip
CMake-76fca308d3e04bc33cb8d03a8d10737e875791be.tar.gz
CMake-76fca308d3e04bc33cb8d03a8d10737e875791be.tar.bz2
ENH: add some better output when copy file fails
-rw-r--r--Source/cmSystemTools.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1b0cbc5..b6d6375 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -22,6 +22,8 @@
#include <ctype.h>
#include "cmDirectory.h"
#include "cmMakefile.h"
+#include <errno.h>
+
// support for realpath call
#ifndef _WIN32
@@ -1203,9 +1205,13 @@ void cmSystemTools::cmCopyFile(const char* source,
std::ifstream fin(source);
#endif
if(!fin)
- {
- cmSystemTools::Error("CopyFile failed to open input file \"",
- source, "\"");
+ {
+ std::string m = "CopyFile failed to open input file \"";
+ m += source;
+ m += "\"";
+ m += " System Error: ";
+ m += strerror(errno);
+ cmSystemTools::Error(m.c_str());
return;
}
@@ -1218,8 +1224,12 @@ void cmSystemTools::cmCopyFile(const char* source,
#endif
if(!fout)
{
- cmSystemTools::Error("CopyFile failed to open output file \"",
- destination, "\"");
+ std::string m = "CopyFile failed to open output file \"";
+ m += destination;
+ m += "\"";
+ m += " System Error: ";
+ m += strerror(errno);
+ cmSystemTools::Error(m.c_str());
return;
}