Fix type warning on Windows.

Add cast since read / write has unsigned return type on windows.
This commit is contained in:
Qi Wang
2018-04-06 11:40:44 -07:00
committed by Qi Wang
parent 4df483f0fd
commit d3e0976a2c
5 changed files with 44 additions and 31 deletions

View File

@@ -978,7 +978,7 @@ prof_dump_flush(bool propagate_err) {
cassert(config_prof);
err = write(prof_dump_fd, prof_dump_buf, prof_dump_buf_end);
err = malloc_write_fd(prof_dump_fd, prof_dump_buf, prof_dump_buf_end);
if (err == -1) {
if (!propagate_err) {
malloc_write("<jemalloc>: write() failed during heap "
@@ -1471,8 +1471,9 @@ prof_dump_maps(bool propagate_err) {
goto label_return;
}
}
nread = read(mfd, &prof_dump_buf[prof_dump_buf_end],
PROF_DUMP_BUFSIZE - prof_dump_buf_end);
nread = malloc_read_fd(mfd,
&prof_dump_buf[prof_dump_buf_end], PROF_DUMP_BUFSIZE
- prof_dump_buf_end);
} while (nread > 0);
} else {
ret = true;