Unbreak FreeBSD build (hopefully).

BUG=v8:3548
LOG=y
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/556543004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
svenpanne@chromium.org 2014-09-09 09:21:51 +00:00
parent 84e21c5ec0
commit 72e27a3d6b

View File

@ -131,14 +131,14 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
addr_buffer[0] = '0'; addr_buffer[0] = '0';
addr_buffer[1] = 'x'; addr_buffer[1] = 'x';
addr_buffer[10] = 0; addr_buffer[10] = 0;
int result = read(fd, addr_buffer + 2, 8); ssize_t bytes_read = read(fd, addr_buffer + 2, 8);
if (result < 8) break; if (bytes_read < 8) break;
unsigned start = StringToLong(addr_buffer); unsigned start = StringToLong(addr_buffer);
result = read(fd, addr_buffer + 2, 1); bytes_read = read(fd, addr_buffer + 2, 1);
if (result < 1) break; if (bytes_read < 1) break;
if (addr_buffer[2] != '-') break; if (addr_buffer[2] != '-') break;
result = read(fd, addr_buffer + 2, 8); bytes_read = read(fd, addr_buffer + 2, 8);
if (result < 8) break; if (bytes_read < 8) break;
unsigned end = StringToLong(addr_buffer); unsigned end = StringToLong(addr_buffer);
char buffer[MAP_LENGTH]; char buffer[MAP_LENGTH];
int bytes_read = -1; int bytes_read = -1;
@ -146,8 +146,8 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
bytes_read++; bytes_read++;
if (bytes_read >= MAP_LENGTH - 1) if (bytes_read >= MAP_LENGTH - 1)
break; break;
result = read(fd, buffer + bytes_read, 1); bytes_read = read(fd, buffer + bytes_read, 1);
if (result < 1) break; if (bytes_read < 1) break;
} while (buffer[bytes_read] != '\n'); } while (buffer[bytes_read] != '\n');
buffer[bytes_read] = 0; buffer[bytes_read] = 0;
// Ignore mappings that are not executable. // Ignore mappings that are not executable.