Commit 36ed1f61 authored by ager@chromium.org's avatar ager@chromium.org

Use return value from fwrite in log.cc to please compilers.

BUG=453
Review URL: http://codereview.chromium.org/4002005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5694 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 12a23110
...@@ -1378,8 +1378,10 @@ void Logger::LogCodeInfo() { ...@@ -1378,8 +1378,10 @@ void Logger::LogCodeInfo() {
void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) {
if (!FLAG_ll_prof || Log::output_code_handle_ == NULL) return; if (!FLAG_ll_prof || Log::output_code_handle_ == NULL) return;
int pos = static_cast<int>(ftell(Log::output_code_handle_)); int pos = static_cast<int>(ftell(Log::output_code_handle_));
fwrite(code->instruction_start(), 1, code->instruction_size(), int rv = fwrite(code->instruction_start(), 1, code->instruction_size(),
Log::output_code_handle_); Log::output_code_handle_);
ASSERT(static_cast<size_t>(code->instruction_size()) == rv);
USE(rv);
msg->Append(",%d", pos); msg->Append(",%d", pos);
} }
......
...@@ -206,7 +206,11 @@ OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size, ...@@ -206,7 +206,11 @@ OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size,
void* initial) { void* initial) {
FILE* file = fopen(name, "w+"); FILE* file = fopen(name, "w+");
if (file == NULL) return NULL; if (file == NULL) return NULL;
fwrite(initial, size, 1, file); int result = fwrite(initial, size, 1, file);
if (result < 1) {
fclose(file);
return NULL;
}
void* memory = void* memory =
mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0); mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0);
return new PosixMemoryMappedFile(file, memory, size); return new PosixMemoryMappedFile(file, memory, size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment