diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2011-05-02 14:46:31 (GMT) |
---|---|---|
committer | Nicolas Despres <nicolas.despres@gmail.com> | 2011-05-02 15:21:21 (GMT) |
commit | 9412cb05008437b2ce534871ec86772b107ce23c (patch) | |
tree | 6f4c1eac7f0d6e4608d398b5f415b60c93a780e1 /src/ninja_jumble.cc | |
parent | 5113d8c29f2e165dabb05c5624055020704ba5fc (diff) | |
download | Ninja-9412cb05008437b2ce534871ec86772b107ce23c.zip Ninja-9412cb05008437b2ce534871ec86772b107ce23c.tar.gz Ninja-9412cb05008437b2ce534871ec86772b107ce23c.tar.bz2 |
Return non-zero status when errors occur.
Clean all was not returning non-zero when an error occur (like when
failing to remove a directory). This patch fix the problem and add a test
for it.
Diffstat (limited to 'src/ninja_jumble.cc')
-rw-r--r-- | src/ninja_jumble.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ninja_jumble.cc b/src/ninja_jumble.cc index 1230546..537f48e 100644 --- a/src/ninja_jumble.cc +++ b/src/ninja_jumble.cc @@ -107,17 +107,17 @@ bool RealDiskInterface::MakeDir(const string& path) { return true; } -bool RealDiskInterface::RemoveFile(const string& path) { +int RealDiskInterface::RemoveFile(const string& path) { if (remove(path.c_str()) < 0) { switch (errno) { case ENOENT: - return false; + return 1; default: Error("remove(%s): %s", path.c_str(), strerror(errno)); - return false; + return -1; } } else { - return true; + return 0; } } |