summaryrefslogtreecommitdiffstats
path: root/src/subprocess.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-09-09 22:06:02 (GMT)
committerEvan Martin <martine@danga.com>2011-09-09 22:06:02 (GMT)
commit085572d523b3d1bb40666dfd7a4a93dd1f0d376f (patch)
tree9c0da034dec462ec1e184b79b692e3230fc5b9eb /src/subprocess.cc
parent9a218d7909ad4747fb4de31842bd97f6f4fd3709 (diff)
downloadNinja-085572d523b3d1bb40666dfd7a4a93dd1f0d376f.zip
Ninja-085572d523b3d1bb40666dfd7a4a93dd1f0d376f.tar.gz
Ninja-085572d523b3d1bb40666dfd7a4a93dd1f0d376f.tar.bz2
fix "ignored return value of write" harder
Diffstat (limited to 'src/subprocess.cc')
-rw-r--r--src/subprocess.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/subprocess.cc b/src/subprocess.cc
index 005d368..4426da0 100644
--- a/src/subprocess.cc
+++ b/src/subprocess.cc
@@ -75,8 +75,10 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
// If we get here, something went wrong; the execl should have
// replaced us.
char* err = strerror(errno);
- // If the write fails, there's nothing we can do.
- (void) write(error_pipe, err, strlen(err));
+ if (write(error_pipe, err, strlen(err)) < 0) {
+ // If the write fails, there's nothing we can do.
+ // But this block seems necessary to silence the warning.
+ }
_exit(1);
}