aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/subprocess.cc
diff options
context:
space:
mode:
authorliujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-12-05 22:29:30 +0000
committerliujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-12-05 22:29:30 +0000
commit2bee6e66e841dc4af52b5bf5681d8ad02c3f0ae3 (patch)
treea9d8d90814b05ba50e1fda6949ef57c8a6f8405f /src/google/protobuf/compiler/subprocess.cc
parented95d54e92b4ae97378a8b3966a45b359fd6d4f0 (diff)
downloadprotobuf-2bee6e66e841dc4af52b5bf5681d8ad02c3f0ae3.tar.gz
protobuf-2bee6e66e841dc4af52b5bf5681d8ad02c3f0ae3.tar.bz2
protobuf-2bee6e66e841dc4af52b5bf5681d8ad02c3f0ae3.zip
Fix build warnings for gcc 4.6
Diffstat (limited to 'src/google/protobuf/compiler/subprocess.cc')
-rw-r--r--src/google/protobuf/compiler/subprocess.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/subprocess.cc b/src/google/protobuf/compiler/subprocess.cc
index 860fc875..67da120d 100644
--- a/src/google/protobuf/compiler/subprocess.cc
+++ b/src/google/protobuf/compiler/subprocess.cc
@@ -295,8 +295,8 @@ void Subprocess::Start(const string& program, SearchMode search_mode) {
int stdin_pipe[2];
int stdout_pipe[2];
- pipe(stdin_pipe);
- pipe(stdout_pipe);
+ GOOGLE_CHECK(pipe(stdin_pipe) != -1);
+ GOOGLE_CHECK(pipe(stdout_pipe) != -1);
char* argv[2] = { strdup(program.c_str()), NULL };
@@ -324,9 +324,11 @@ void Subprocess::Start(const string& program, SearchMode search_mode) {
// Write directly to STDERR_FILENO to avoid stdio code paths that may do
// stuff that is unsafe here.
- write(STDERR_FILENO, argv[0], strlen(argv[0]));
+ int ignored;
+ ignored = write(STDERR_FILENO, argv[0], strlen(argv[0]));
const char* message = ": program not found or is not executable\n";
- write(STDERR_FILENO, message, strlen(message));
+ ignored = write(STDERR_FILENO, message, strlen(message));
+ (void) ignored;
// Must use _exit() rather than exit() to avoid flushing output buffers
// that will also be flushed by the parent.