Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41f72f05 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Don\'t create tombstone directory. am: cb9625cb am: 99b8a566 am:...

Don\'t create tombstone directory. am: cb9625cb am: 99b8a566 am: 0cf99e2b am: 338f1802 am: 3ee4a0be
am: 7f0d750b

* commit '7f0d750b':
  Don't create tombstone directory.
parents a03485da 7f0d750b
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -788,21 +788,8 @@ char* engrave_tombstone(pid_t pid, pid_t tid, int signal, int original_si_code,
  log.current_tid = tid;
  log.crashed_tid = tid;

  if ((mkdir(TOMBSTONE_DIR, 0755) == -1) && (errno != EEXIST)) {
    _LOG(&log, logtype::ERROR, "failed to create %s: %s\n", TOMBSTONE_DIR, strerror(errno));
  }

  if (chown(TOMBSTONE_DIR, AID_SYSTEM, AID_SYSTEM) == -1) {
    _LOG(&log, logtype::ERROR, "failed to change ownership of %s: %s\n", TOMBSTONE_DIR, strerror(errno));
  }

  int fd = -1;
  char* path = NULL;
  if (selinux_android_restorecon(TOMBSTONE_DIR, 0) == 0) {
    path = find_and_open_tombstone(&fd);
  } else {
    _LOG(&log, logtype::ERROR, "Failed to restore security context, not writing tombstone.\n");
  }
  char* path = find_and_open_tombstone(&fd);

  if (fd < 0) {
    _LOG(&log, logtype::ERROR, "Skipping tombstone write, nothing to do.\n");