Lines Matching refs:idmap_fd
2251 static void run_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd) in run_idmap() argument
2254 StringPrintf("%d", idmap_fd).c_str(), (char*)nullptr); in run_idmap()
2258 static void run_verify_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd) in run_verify_idmap() argument
2261 StringPrintf("%d", idmap_fd).c_str(), (char*)nullptr); in run_verify_idmap()
2267 int idmap_fd = open(idmap_path, O_RDWR); in delete_stale_idmap() local
2268 if (idmap_fd < 0) { in delete_stale_idmap()
2286 if (flock(idmap_fd, LOCK_EX | LOCK_NB) != 0) { in delete_stale_idmap()
2291 run_verify_idmap(target_apk, overlay_apk, idmap_fd); in delete_stale_idmap()
2295 close(idmap_fd); in delete_stale_idmap()
2353 int idmap_fd = -1; in idmap() local
2371 idmap_fd = open(idmap_path, O_RDWR | O_CREAT | O_EXCL, 0644); in idmap()
2373 idmap_fd = open(idmap_path, O_RDWR); in idmap()
2376 if (idmap_fd < 0) { in idmap()
2380 if (fchown(idmap_fd, AID_SYSTEM, uid) < 0) { in idmap()
2384 if (fchmod(idmap_fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0) { in idmap()
2390 close(idmap_fd); in idmap()
2406 if (flock(idmap_fd, LOCK_EX | LOCK_NB) != 0) { in idmap()
2411 run_idmap(target_apk, overlay_apk, idmap_fd); in idmap()
2421 close(idmap_fd); in idmap()
2424 if (idmap_fd >= 0) { in idmap()
2425 close(idmap_fd); in idmap()