summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/build_log.cc4
-rw-r--r--src/deps_log.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index 0a2fac6..04409c8 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -190,7 +190,9 @@ bool BuildLog::OpenForWriteIfNeeded() {
if (!log_file_) {
return false;
}
- setvbuf(log_file_, NULL, _IOLBF, BUFSIZ);
+ if (setvbuf(log_file_, NULL, _IOLBF, BUFSIZ) != 0) {
+ return false;
+ }
SetCloseOnExec(fileno(log_file_));
// Opening a file in append mode doesn't set the file pointer to the file's
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