Index: src/base/platform/platform-freebsd.cc |
diff --git a/src/base/platform/platform-freebsd.cc b/src/base/platform/platform-freebsd.cc |
index 23808f67810ee1b1de6cf8422ab71a3fefc82bb6..507b946f69f57fe001e475169d35256d7070bcd0 100644 |
--- a/src/base/platform/platform-freebsd.cc |
+++ b/src/base/platform/platform-freebsd.cc |
@@ -131,14 +131,14 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() { |
addr_buffer[0] = '0'; |
addr_buffer[1] = 'x'; |
addr_buffer[10] = 0; |
- int result = read(fd, addr_buffer + 2, 8); |
- if (result < 8) break; |
+ ssize_t bytes_read = read(fd, addr_buffer + 2, 8); |
+ if (bytes_read < 8) break; |
unsigned start = StringToLong(addr_buffer); |
- result = read(fd, addr_buffer + 2, 1); |
- if (result < 1) break; |
+ bytes_read = read(fd, addr_buffer + 2, 1); |
+ if (bytes_read < 1) break; |
if (addr_buffer[2] != '-') break; |
- result = read(fd, addr_buffer + 2, 8); |
- if (result < 8) break; |
+ bytes_read = read(fd, addr_buffer + 2, 8); |
+ if (bytes_read < 8) break; |
unsigned end = StringToLong(addr_buffer); |
char buffer[MAP_LENGTH]; |
int bytes_read = -1; |
@@ -146,8 +146,8 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() { |
bytes_read++; |
if (bytes_read >= MAP_LENGTH - 1) |
break; |
- result = read(fd, buffer + bytes_read, 1); |
- if (result < 1) break; |
+ bytes_read = read(fd, buffer + bytes_read, 1); |
+ if (bytes_read < 1) break; |
} while (buffer[bytes_read] != '\n'); |
buffer[bytes_read] = 0; |
// Ignore mappings that are not executable. |