diff options
author | Evan Martin <martine@danga.com> | 2013-04-08 17:20:58 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2013-04-09 04:04:55 (GMT) |
commit | 0397155218f3d311200ec4e25786028f14c53c6a (patch) | |
tree | 7e68d3f5403c4e6979541c2c9922d2248163467c /src/deps_log.cc | |
parent | 8ec425abe38f468bc4bbb4c95d78fab3b93d2141 (diff) | |
download | Ninja-0397155218f3d311200ec4e25786028f14c53c6a.zip Ninja-0397155218f3d311200ec4e25786028f14c53c6a.tar.gz Ninja-0397155218f3d311200ec4e25786028f14c53c6a.tar.bz2 |
add a test for the "deps out of date" case
It touched the various remaining XXXes in the code, hooray.
Diffstat (limited to 'src/deps_log.cc')
-rw-r--r-- | src/deps_log.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc index 454d2e5..5590a32 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -30,6 +30,9 @@ const char kFileSignature[] = "# ninja deps v%d\n"; const int kCurrentVersion = 1; } // anonymous namespace +DepsLog::~DepsLog() { + Close(); +} bool DepsLog::OpenForWrite(const string& path, string* err) { file_ = fopen(path.c_str(), "ab"); @@ -113,7 +116,8 @@ bool DepsLog::RecordDeps(Node* node, TimeStamp mtime, } void DepsLog::Close() { - fclose(file_); + if (file_) + fclose(file_); file_ = NULL; } |