projects
/
platform
/
upstream
/
ninja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a218d7
)
fix "ignored return value of write" harder
author
Evan Martin
<martine@danga.com>
Fri, 9 Sep 2011 22:06:02 +0000
(15:06 -0700)
committer
Evan Martin
<martine@danga.com>
Fri, 9 Sep 2011 22:06:02 +0000
(15:06 -0700)
src/subprocess.cc
patch
|
blob
|
history
diff --git
a/src/subprocess.cc
b/src/subprocess.cc
index
005d368
..
4426da0
100644
(file)
--- 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);
}