summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/build_log.cc8
-rw-r--r--src/build_log.h3
2 files changed, 8 insertions, 3 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index 852a9d0..e3e96e5 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -35,11 +35,15 @@ namespace {
const char kFileSignature[] = "# ninja log v%d\n";
const int kCurrentVersion = 3;
-}
+} // namespace
BuildLog::BuildLog()
: log_file_(NULL), config_(NULL), needs_recompaction_(false) {}
+BuildLog::~BuildLog() {
+ Close();
+}
+
bool BuildLog::OpenForWrite(const string& path, string* err) {
if (config_ && config_->dry_run)
return true; // Do nothing, report success.
@@ -144,7 +148,7 @@ bool BuildLog::Load(const string& path, string* err) {
end_time = atoi(start);
start = end + 1;
}
-
+
if (log_version >= 3) {
// In v3 we log the restat mtime.
char* end = strchr(start, ' ');
diff --git a/src/build_log.h b/src/build_log.h
index 99ae5a0..ee63ed2 100644
--- a/src/build_log.h
+++ b/src/build_log.h
@@ -34,7 +34,7 @@ struct Edge;
/// from it
struct BuildLog {
BuildLog();
- ~BuildLog() { Close(); }
+ ~BuildLog();
void SetConfig(BuildConfig* config) { config_ = config; }
bool OpenForWrite(const string& path, string* err);
@@ -69,6 +69,7 @@ struct BuildLog {
/// Rewrite the known log entries, throwing away old data.
bool Recompact(const string& path, string* err);
+ private:
typedef ExternalStringHashMap<LogEntry*>::Type Log;
Log log_;
FILE* log_file_;