Loading debuggerd/tombstone.cpp +15 −8 Original line number Original line Diff line number Diff line Loading @@ -742,26 +742,33 @@ char* engrave_tombstone( mkdir(TOMBSTONE_DIR, 0755); mkdir(TOMBSTONE_DIR, 0755); chown(TOMBSTONE_DIR, AID_SYSTEM, AID_SYSTEM); chown(TOMBSTONE_DIR, AID_SYSTEM, AID_SYSTEM); if (selinux_android_restorecon(TOMBSTONE_DIR) == -1) { int fd = -1; *detach_failed = false; char* path = NULL; return NULL; if (selinux_android_restorecon(TOMBSTONE_DIR) == 0) { path = find_and_open_tombstone(&fd); } else { LOG("Failed to restore security context, not writing tombstone.\n"); } } int fd; if (fd < 0 && quiet) { char* path = find_and_open_tombstone(&fd); LOG("Skipping tombstone write, nothing to do.\n"); if (!path) { *detach_failed = false; *detach_failed = false; return NULL; return NULL; } } log_t log; log_t log; log.tfd = fd; log.tfd = fd; log.amfd = activity_manager_connect(); // Preserve amfd since it can be modified through the calls below without // being closed. int amfd = activity_manager_connect(); log.amfd = amfd; log.quiet = quiet; log.quiet = quiet; *detach_failed = dump_crash( *detach_failed = dump_crash( &log, pid, tid, signal, abort_msg_address, dump_sibling_threads, total_sleep_time_usec); &log, pid, tid, signal, abort_msg_address, dump_sibling_threads, total_sleep_time_usec); close(log.amfd); // Either of these file descriptors can be -1, any error is ignored. close(amfd); close(fd); close(fd); return path; return path; } } Loading
debuggerd/tombstone.cpp +15 −8 Original line number Original line Diff line number Diff line Loading @@ -742,26 +742,33 @@ char* engrave_tombstone( mkdir(TOMBSTONE_DIR, 0755); mkdir(TOMBSTONE_DIR, 0755); chown(TOMBSTONE_DIR, AID_SYSTEM, AID_SYSTEM); chown(TOMBSTONE_DIR, AID_SYSTEM, AID_SYSTEM); if (selinux_android_restorecon(TOMBSTONE_DIR) == -1) { int fd = -1; *detach_failed = false; char* path = NULL; return NULL; if (selinux_android_restorecon(TOMBSTONE_DIR) == 0) { path = find_and_open_tombstone(&fd); } else { LOG("Failed to restore security context, not writing tombstone.\n"); } } int fd; if (fd < 0 && quiet) { char* path = find_and_open_tombstone(&fd); LOG("Skipping tombstone write, nothing to do.\n"); if (!path) { *detach_failed = false; *detach_failed = false; return NULL; return NULL; } } log_t log; log_t log; log.tfd = fd; log.tfd = fd; log.amfd = activity_manager_connect(); // Preserve amfd since it can be modified through the calls below without // being closed. int amfd = activity_manager_connect(); log.amfd = amfd; log.quiet = quiet; log.quiet = quiet; *detach_failed = dump_crash( *detach_failed = dump_crash( &log, pid, tid, signal, abort_msg_address, dump_sibling_threads, total_sleep_time_usec); &log, pid, tid, signal, abort_msg_address, dump_sibling_threads, total_sleep_time_usec); close(log.amfd); // Either of these file descriptors can be -1, any error is ignored. close(amfd); close(fd); close(fd); return path; return path; } }