OSDN Git Service

Zygote: Better logging for setgroups failures.
authorNarayan Kamath <narayan@google.com>
Tue, 9 Aug 2016 16:23:31 +0000 (17:23 +0100)
committerNarayan Kamath <narayan@google.com>
Tue, 9 Aug 2016 17:17:02 +0000 (18:17 +0100)
bug: 28865594
Change-Id: I88590afe6a05e2d1967c9bca74c79de3871440b8

core/jni/com_android_internal_os_Zygote.cpp

index 3f4b2a6..a04fc2a 100644 (file)
@@ -176,7 +176,9 @@ static void SetGids(JNIEnv* env, jintArray javaGids) {
   }
   int rc = setgroups(gids.size(), reinterpret_cast<const gid_t*>(&gids[0]));
   if (rc == -1) {
-    RuntimeAbort(env, __LINE__, "setgroups failed");
+    std::ostringstream oss;
+    oss << "setgroups failed: " << strerror(errno) << ", gids.size=" << gids.size();
+    RuntimeAbort(env, __LINE__, oss.str().c_str());
   }
 }