aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/util/file_posix.cc
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2016-11-22 14:02:07 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-11-22 14:15:35 +0000
commitbc3f2649adee9ace37960370626b0273bfb15e11 (patch)
tree44f31f061808453261be83e12c84e3ffc601e3ce /src/main/cpp/util/file_posix.cc
parenta23068a19a00515555526e2e377f1ec540ed7a40 (diff)
Bazel client: fix compiler warnings
-- MOS_MIGRATED_REVID=139899429
Diffstat (limited to 'src/main/cpp/util/file_posix.cc')
-rw-r--r--src/main/cpp/util/file_posix.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main/cpp/util/file_posix.cc b/src/main/cpp/util/file_posix.cc
index 5bb8772d70..08a38cc102 100644
--- a/src/main/cpp/util/file_posix.cc
+++ b/src/main/cpp/util/file_posix.cc
@@ -45,15 +45,12 @@ class PosixPipe : public IPipe {
close(_send_socket);
}
- // Sends `size` bytes from `buffer` through the pipe.
- bool Send(void* buffer, size_t size) override {
- return write(_send_socket, buffer, size) == size;
+ bool Send(void* buffer, int size) override {
+ return size >= 0 && write(_send_socket, buffer, size) == size;
}
- // Receives at most `size` bytes into `buffer` from the pipe.
- // Returns the number of bytes received; sets `errno` upon error.
- int Receive(void* buffer, size_t size) override {
- return read(_recv_socket, buffer, size);
+ int Receive(void* buffer, int size) override {
+ return size < 0 ? -1 : read(_recv_socket, buffer, size);
}
private: