summaryrefslogtreecommitdiffstats
path: root/src/build_log.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-05-08 15:37:27 (GMT)
committerNico Weber <nicolasweber@gmx.de>2012-05-08 15:37:27 (GMT)
commitfadd5a3e8073ad08662cdf86bd1c9ab624667f4c (patch)
tree4a092eaa1a59393fa956db0a0cba2f3ed3f748b0 /src/build_log.cc
parentff16370b605c3f668444484eaea2c10a0b62b72f (diff)
downloadNinja-fadd5a3e8073ad08662cdf86bd1c9ab624667f4c.zip
Ninja-fadd5a3e8073ad08662cdf86bd1c9ab624667f4c.tar.gz
Ninja-fadd5a3e8073ad08662cdf86bd1c9ab624667f4c.tar.bz2
Don't write ninja log header to log on every build on Windows.
Diffstat (limited to 'src/build_log.cc')
-rw-r--r--src/build_log.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index d30625a..b743f70 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -66,6 +66,10 @@ bool BuildLog::OpenForWrite(const string& path, string* err) {
setvbuf(log_file_, NULL, _IOLBF, BUFSIZ);
SetCloseOnExec(fileno(log_file_));
+ // Opening a file in append mode doesn't set the file pointer to the file's
+ // end on Windows. Do that explicitly.
+ fseek(log_file_, 0, SEEK_END);
+
if (ftell(log_file_) == 0) {
if (fprintf(log_file_, kFileSignature, kCurrentVersion) < 0) {
*err = strerror(errno);