Use mmap_data more widely

This commit is contained in:
topjohnwu
2021-11-30 01:50:55 -08:00
parent 2d82ad93dd
commit 1443a5b175
19 changed files with 168 additions and 276 deletions

View File

@@ -74,12 +74,9 @@ static bool check_precompiled(const char *precompiled) {
}
static void load_cil(struct cil_db *db, const char *file) {
char *addr;
size_t size;
mmap_ro(file, addr, size);
cil_add_file(db, (char *) file, addr, size);
auto d = mmap_data(file);
cil_add_file(db, (char *) file, (char *) d.buf, d.sz);
LOGD("cil_add [%s]\n", file);
munmap(addr, size);
}
sepolicy *sepolicy::from_file(const char *file) {