summaryrefslogtreecommitdiffstats
path: root/src/deps_log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/deps_log.cc')
-rw-r--r--src/deps_log.cc6
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;
}