OSDN Git Service

resolved conflicts for merge of 7c03fb79 to jb-dev-plus-aosp
authorElliott Hughes <enh@google.com>
Thu, 21 Jun 2012 21:15:11 +0000 (14:15 -0700)
committerElliott Hughes <enh@google.com>
Thu, 21 Jun 2012 21:15:11 +0000 (14:15 -0700)
Change-Id: Icedbe5a6d7cbcedde53e05249f7e90a390f2f0ea

1  2 
vm/ReconfigureDvm.mk
vm/native/dalvik_system_Zygote.cpp

@@@ -26,8 -26,14 +26,14 @@@ endi
  
  include $(LOCAL_PATH)/Dvm.mk
  
 -LOCAL_SHARED_LIBRARIES += liblog libcutils libnativehelper libz libdl
 +LOCAL_SHARED_LIBRARIES += liblog libcutils libnativehelper libz libdl libcorkscrew
  
+ ifeq ($(HAVE_SELINUX),true)
+ LOCAL_C_INCLUDES += external/libselinux/include
+ LOCAL_SHARED_LIBRARIES += libselinux
+ LOCAL_CFLAGS += -DHAVE_SELINUX
+ endif # HAVE_SELINUX
  LOCAL_STATIC_LIBRARIES += libdex
  
  LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
@@@ -461,12 -503,16 +504,25 @@@ static pid_t forkAndSpecializeCommon(co
              dvmAbort();
          }
  
 +        err = set_sched_policy(0, SP_DEFAULT);
 +        if (err < 0) {
 +            ALOGE("cannot set_sched_policy(0, SP_DEFAULT): %s", strerror(-err));
 +            dvmAbort();
 +        }
 +
+ #ifdef HAVE_SELINUX
+         err = setSELinuxContext(uid, isSystemServer, seInfo, niceName);
+         if (err < 0) {
+             LOGE("cannot set SELinux context: %s\n", strerror(errno));
+             dvmAbort();
+         }
++        // These free(3) calls are safe because we know we're only ever forking
++        // a single-threaded process, so we know no other thread held the heap
++        // lock when we forked.
+         free(seInfo);
+         free(niceName);
+ #endif
          /*
           * Our system thread ID has changed.  Get the new one.
           */