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

Commit f96d9741 authored by Andreas Gampe's avatar Andreas Gampe Committed by android-build-merger
Browse files

Merge "Zygote: Set libbase default tag on fork"

am: cb114c54

Change-Id: I7e7cb2d0b4b237a1f0314d4c236f080df796df23
parents e0a06e21 cb114c54
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -488,6 +488,8 @@ void SetThreadName(const char* thread_name) {
  if (errno != 0) {
  if (errno != 0) {
    ALOGW("Unable to set the name of current thread to '%s': %s", buf, strerror(errno));
    ALOGW("Unable to set the name of current thread to '%s': %s", buf, strerror(errno));
  }
  }
  // Update base::logging default tag.
  android::base::SetDefaultTag(buf);
}
}


// The list of open zygote file descriptors.
// The list of open zygote file descriptors.
@@ -685,10 +687,10 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra


    // Make it easier to debug audit logs by setting the main thread's name to the
    // Make it easier to debug audit logs by setting the main thread's name to the
    // nice name rather than "app_process".
    // nice name rather than "app_process".
    if (se_info_c_str == NULL && is_system_server) {
    if (se_name_c_str == NULL && is_system_server) {
      se_name_c_str = "system_server";
      se_name_c_str = "system_server";
    }
    }
    if (se_info_c_str != NULL) {
    if (se_name_c_str != NULL) {
      SetThreadName(se_name_c_str);
      SetThreadName(se_name_c_str);
    }
    }