diff options
author | Evan Martin <martine@danga.com> | 2011-05-02 18:39:45 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-02 18:39:45 (GMT) |
commit | e017ea09aff29f258603bad57cab130038044a82 (patch) | |
tree | edc604c3e2632ec2f1d27733dc67f8162644af06 /src/ninja_jumble.cc | |
parent | a13487aedcf6691aaff82e97c5056973c98fd1cd (diff) | |
parent | 81eed8604564c8f9414c3736253290ee5a0db457 (diff) | |
download | Ninja-e017ea09aff29f258603bad57cab130038044a82.zip Ninja-e017ea09aff29f258603bad57cab130038044a82.tar.gz Ninja-e017ea09aff29f258603bad57cab130038044a82.tar.bz2 |
Merge pull request #36 from polrop/test-clean-tool.
Test clean tool
Diffstat (limited to 'src/ninja_jumble.cc')
-rw-r--r-- | src/ninja_jumble.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ninja_jumble.cc b/src/ninja_jumble.cc index 9ee6766..bef562b 100644 --- a/src/ninja_jumble.cc +++ b/src/ninja_jumble.cc @@ -107,6 +107,20 @@ bool RealDiskInterface::MakeDir(const string& path) { return true; } +int RealDiskInterface::RemoveFile(const string& path) { + if (remove(path.c_str()) < 0) { + switch (errno) { + case ENOENT: + return 1; + default: + Error("remove(%s): %s", path.c_str(), strerror(errno)); + return -1; + } + } else { + return 0; + } +} + FileStat* StatCache::GetFile(const string& path) { Paths::iterator i = paths_.find(path); if (i != paths_.end()) |