diff options
author | Craig Scott <craig.scott@crascit.com> | 2018-03-04 06:27:09 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2018-03-08 09:07:14 (GMT) |
commit | e60e4dfc88252aaec53f0d832508d41dff6165fd (patch) | |
tree | 5903e9e8f2eb57780d47a21d83f282f9cee11741 /Source/cmake.cxx | |
parent | e654622aee22655c418a9c663fad79243ca0c819 (diff) | |
download | CMake-e60e4dfc88252aaec53f0d832508d41dff6165fd.zip CMake-e60e4dfc88252aaec53f0d832508d41dff6165fd.tar.gz CMake-e60e4dfc88252aaec53f0d832508d41dff6165fd.tar.bz2 |
cmWorkingDirectory: Check success of current dir changes
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f4f4a15..323bcf6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -98,13 +98,13 @@ #include "cmsys/Glob.hxx" #include "cmsys/RegularExpression.hxx" #include <algorithm> +#include <cstring> #include <iostream> #include <iterator> #include <memory> // IWYU pragma: keep #include <sstream> #include <stdio.h> #include <stdlib.h> -#include <string.h> #include <utility> namespace { @@ -2209,6 +2209,15 @@ int cmake::GetSystemInformation(std::vector<std::string>& args) { // now run cmake on the CMakeLists file cmWorkingDirectory workdir(destPath); + if (workdir.Failed()) { + // We created the directory and we were able to copy the CMakeLists.txt + // file to it, so we wouldn't expect to get here unless the default + // permissions are questionable or some other process has deleted the + // directory + std::cerr << "Failed to change to directory " << destPath << " : " + << std::strerror(workdir.GetLastResult()) << std::endl; + return 1; + } std::vector<std::string> args2; args2.push_back(args[0]); args2.push_back(destPath); |