OSDN Git Service

Zygote: address comments from previous review.
authorNick Kralevich <nnk@google.com>
Thu, 14 Feb 2013 19:00:33 +0000 (11:00 -0800)
committerNick Kralevich <nnk@google.com>
Thu, 14 Feb 2013 19:00:33 +0000 (11:00 -0800)
Previous review at https://android-review.googlesource.com/51731

Change-Id: Idfe6c95976cc8f82ec473bcb630678fa9ec9486a

vm/native/dalvik_system_Zygote.cpp

index 6a03468..7b97d95 100644 (file)
@@ -592,10 +592,15 @@ static pid_t forkAndSpecializeCommon(const u4* args, bool isSystemServer)
             }
             err = prctl(PR_CAPBSET_DROP, i, 0, 0, 0);
             if (err < 0) {
-                ALOGW("PR_CAPBSET_DROP %d failed: %s. "
-                      "Please make sure your kernel is compiled with file "
-                      "capabilities support enabled.",
-                      i, strerror(errno));
+                if (errno == EINVAL) {
+                    ALOGW("PR_CAPBSET_DROP %d failed: %s. "
+                          "Please make sure your kernel is compiled with "
+                          "file capabilities support enabled.",
+                          i, strerror(errno));
+                } else {
+                    ALOGE("PR_CAPBSET_DROP %d failed: %s.", i, strerror(errno));
+                    dvmAbort();
+                }
             }
         }