diff options
author | Benjamin Peterson <bp@benjamin.pe> | 2017-05-31 10:15:44 +0200 |
---|---|---|
committer | László Csomor <laszlocsomor@google.com> | 2017-05-31 13:53:29 +0200 |
commit | 341c08d7c32e539da6246b05ce55c6fe6343b79d (patch) | |
tree | cea0de9e97e690588db0b2bb4a1c058d3a5b0e70 | |
parent | 0a936d104922065fdfde80a6c9a328086d3dcad3 (diff) |
fix signedness warnings in blaze_util_posix.cc
if (result != count) {
~~~~~~~^~~~~~~~
Of course, problems arising from this are only theoretical.
Change-Id: Id045a97623026e005d40940eb4a7d30d73f4ce32
PiperOrigin-RevId: 157561218
-rw-r--r-- | src/main/cpp/blaze_util_posix.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/cpp/blaze_util_posix.cc b/src/main/cpp/blaze_util_posix.cc index 0ccf966972..d5aa37b2dc 100644 --- a/src/main/cpp/blaze_util_posix.cc +++ b/src/main/cpp/blaze_util_posix.cc @@ -148,7 +148,7 @@ string GetJavaBinaryUnderJavabase() { return "bin/java"; } // binary anyway. const char** ConvertStringVectorToArgv(const vector<string>& args) { const char** argv = new const char*[args.size() + 1]; - for (int i = 0; i < args.size(); i++) { + for (size_t i = 0; i < args.size(); i++) { argv[i] = args[i].c_str(); } @@ -276,7 +276,7 @@ static void ReadFromFdWithRetryEintr( do { result = read(fd, buf, count); } while (result < 0 && errno == EINTR); - if (result != count) { + if (result < 0 || static_cast<size_t>(result) != count) { DieAfterFork(error_message); } } @@ -291,7 +291,7 @@ static void WriteToFdWithRetryEintr( // Darwin. result = write(fd, buf, count); } while (result < 0 && errno == EINTR); - if (result != count) { + if (result < 0 || static_cast<size_t>(result) != count) { DieAfterFork(error_message); } } |