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.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc
index 0567c95..191f300 100644
--- a/src/deps_log.cc
+++ b/src/deps_log.cc
@@ -413,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