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
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.
*/