summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-12 14:40:14 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-12 14:40:14 (GMT)
commit219bcf25ba5d6dca20971373266c2d02e75b50e0 (patch)
tree5010709793c97ac0c78357d9211dba5066662459
parent2dc914c8399c038946dd4569b4ff435ad9618426 (diff)
downloadCMake-219bcf25ba5d6dca20971373266c2d02e75b50e0.zip
CMake-219bcf25ba5d6dca20971373266c2d02e75b50e0.tar.gz
CMake-219bcf25ba5d6dca20971373266c2d02e75b50e0.tar.bz2
BUG: When removing directory, use lstat instead of stat to make sure that symlinks are treated as files and not as directories
-rw-r--r--Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx4
-rw-r--r--Source/kwsys/SystemTools.cxx4
2 files changed, 7 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
index 024ed21..5784656 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
@@ -29,7 +29,9 @@ bool cmCTestEmptyBinaryDirectoryCommand::InitialPass(
if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) )
{
- this->SetError("problem removing the binary directory");
+ cmOStringStream ostr;
+ ostr << "problem removing the binary directory: " << args[0].c_str();
+ this->SetError(ostr.str().c_str());
return false;
}
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index f5c4507..157ea55 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2044,7 +2044,11 @@ kwsys_stl::string SystemTools
bool SystemTools::FileIsDirectory(const char* name)
{
struct stat fs;
+#if _WIN32
if(stat(name, &fs) == 0)
+#else
+ if(lstat(name, &fs) == 0)
+#endif
{
#if _WIN32
return ((fs.st_mode & _S_IFDIR) != 0);