diff options
author | Evan Martin <martine@danga.com> | 2012-08-07 20:58:55 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-08-07 21:03:00 (GMT) |
commit | cc222d3f6ba769fd800b1dfdb1699fbb84516c7b (patch) | |
tree | 99f395a2f120ffbdd1d1390c8e5d6205d346354f /src/util.cc | |
parent | 645165bca247558f94d5f47cf7795c463e81d83a (diff) | |
download | Ninja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.zip Ninja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.tar.gz Ninja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.tar.bz2 |
use DiskInterface to create the build directory
Fixes issue #392 (didn't handle creating nested build dirs right).
Moves MakeDir out of util.h; all code should go through
DiskInterface to simplify testing. Moves ownership of the
DiskInterface into the client of the Builder, which also allows
removing some code that reached inside the object as well as
a minor leak.
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/util.cc b/src/util.cc index be2347c..7c2f895 100644 --- a/src/util.cc +++ b/src/util.cc @@ -34,10 +34,6 @@ #include <vector> -#ifdef _WIN32 -#include <direct.h> // _mkdir -#endif - #if defined(__APPLE__) || defined(__FreeBSD__) #include <sys/sysctl.h> #elif defined(linux) @@ -163,14 +159,6 @@ bool CanonicalizePath(char* path, int* len, string* err) { return true; } -int MakeDir(const string& path) { -#ifdef _WIN32 - return _mkdir(path.c_str()); -#else - return mkdir(path.c_str(), 0777); -#endif -} - int ReadFile(const string& path, string* contents, string* err) { FILE* f = fopen(path.c_str(), "r"); if (!f) { |