summaryrefslogtreecommitdiffstats
path: root/src/deps_log.cc
diff options
context:
space:
mode:
authorJan Niklas Hasse <jhasse@bixense.com>2020-11-28 11:22:23 (GMT)
committerJan Niklas Hasse <jhasse@bixense.com>2020-11-28 11:22:23 (GMT)
commit9cf70a20685ac3bd48fceac2ea268d449c7e78d5 (patch)
tree433402b91ee03f5a476da5c0bdb26f6d3bad7809 /src/deps_log.cc
parenta1f879b29c9aafe6a2bc0ba885701f8f4f19f772 (diff)
parented056bdd8c8d578a9952bd93b76f29c14199c85b (diff)
downloadNinja-9cf70a20685ac3bd48fceac2ea268d449c7e78d5.zip
Ninja-9cf70a20685ac3bd48fceac2ea268d449c7e78d5.tar.gz
Ninja-9cf70a20685ac3bd48fceac2ea268d449c7e78d5.tar.bz2
Merge branch 'master' into release
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 1fb65ae..191f300 100644
--- a/src/deps_log.cc
+++ b/src/deps_log.cc
@@ -30,6 +30,8 @@ typedef unsigned __int32 uint32_t;
#include "state.h"
#include "util.h"
+using namespace std;
+
// The version is stored as 4 bytes after the signature and also serves as a
// byte order mark. Signature and version combined are 16 bytes long.
const char kFileSignature[] = "# ninjadeps\n";
@@ -411,7 +413,9 @@ bool DepsLog::OpenForWriteIfNeeded() {
}
// Set the buffer size to this and flush the file buffer after every record
// to make sure records aren't written partially.
- setvbuf(file_, NULL, _IOFBF, kMaxRecordSize + 1);
+ if (setvbuf(file_, NULL, _IOFBF, kMaxRecordSize + 1) != 0) {
+ return false;
+ }
SetCloseOnExec(fileno(file_));
// Opening a file in append mode doesn't set the file pointer to the file's