tr_event_pointer = nullptr;
}
if (pc_fd != kInvalidFd) {
- internal_close(pc_fd);
+ CloseFile(pc_fd);
pc_fd = kInvalidFd;
}
}
fd_t fd = CovOpenFile(&path, false, "trace-points");
if (fd == kInvalidFd) return;
internal_write(fd, out.data(), out.length());
- internal_close(fd);
+ CloseFile(fd);
fd = CovOpenFile(&path, false, "trace-compunits");
if (fd == kInvalidFd) return;
for (uptr i = 0; i < comp_unit_name_vec.size(); i++)
out.append("%s\n", comp_unit_name_vec[i].copied_module_name);
internal_write(fd, out.data(), out.length());
- internal_close(fd);
+ CloseFile(fd);
fd = CovOpenFile(&path, false, "trace-events");
if (fd == kInvalidFd) return;
break;
}
}
- internal_close(fd);
+ CloseFile(fd);
VReport(1, " CovDump: Trace: %zd PCs written\n", size());
VReport(1, " CovDump: Trace: %zd Events written\n", max_idx);
}
fd_t fd = CovOpenFile(&path, false, "caller-callee");
if (fd == kInvalidFd) return;
internal_write(fd, out.data(), out.length());
- internal_close(fd);
+ CloseFile(fd);
VReport(1, " CovDump: %zd caller-callee pairs written\n", total);
}
CovOpenFile(&path, /* packed */ false, base_name, "counters-sancov");
if (fd == kInvalidFd) return;
internal_write(fd, bitset.data() + r.beg, r.end - r.beg);
- internal_close(fd);
+ CloseFile(fd);
VReport(1, " CovDump: %zd counters written for '%s'\n", r.end - r.beg,
base_name);
}
fd_t fd = CovOpenFile(&path, /* packed */false, base_name, "bitset-sancov");
if (fd == kInvalidFd) return;
internal_write(fd, out.data() + r.beg, r.end - r.beg);
- internal_close(fd);
+ CloseFile(fd);
VReport(1,
" CovDump: bitset of %zd bits written for '%s', %zd bits are set\n",
r.end - r.beg, base_name, n_set_bits);
fd_t fd = CovOpenFile(&path, false /* packed */, module_name);
if (fd == kInvalidFd) continue;
internal_write(fd, offsets.data(), offsets.size() * sizeof(offsets[0]));
- internal_close(fd);
+ CloseFile(fd);
VReport(1, " CovDump: %s: %zd PCs written\n", path.data(), num_offsets);
}
}
if (cov_fd != kInvalidFd)
- internal_close(cov_fd);
+ CloseFile(cov_fd);
}
void CoverageData::DumpAll() {
ASSERT_NE(fd, kInvalidFd);
EXPECT_EQ(len1, internal_write(fd, str1, len1));
EXPECT_EQ(len2, internal_write(fd, str2, len2));
- internal_close(fd);
+ CloseFile(fd);
fd = OpenFile(tmpfile, RdOnly);
ASSERT_NE(fd, kInvalidFd);
internal_memset(buf, 0, len1);
EXPECT_EQ(len2, internal_read(fd, buf, len2));
EXPECT_EQ(0, internal_memcmp(buf, str2, len2));
- internal_close(fd);
+ CloseFile(fd);
internal_unlink(tmpfile);
}
#endif
ASSERT_EQ('A', p[0]);
ASSERT_EQ('B', p[1]);
- internal_close(fd);
+ CloseFile(fd);
UnmapOrDie(p, page_size);
internal_unlink(tmpfile);
}