Merge change 24479 into eclair

* changes:
  Implement a simple peephole optimization framework for ARM.
diff --git a/libzipfile/centraldir.c b/libzipfile/centraldir.c
index 0391c09..0e264a3 100644
--- a/libzipfile/centraldir.c
+++ b/libzipfile/centraldir.c
@@ -233,7 +233,7 @@
     len = (buf+bufsize)-p;

     for (i=0; i < file->totalEntryCount; i++) {

         Zipentry* entry = malloc(sizeof(Zipentry));

-        memset(entry, sizeof(Zipentry), 0);

+        memset(entry, 0, sizeof(Zipentry));

 

         err = read_central_directory_entry(file, entry, &p, &len);

         if (err != 0) {

diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 779f2a9..e28dd30 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -5,11 +5,15 @@
 
 copy_from := \
 	etc/dbus.conf \
-	etc/init.goldfish.sh \
 	etc/hosts
 
 ifeq ($(TARGET_PRODUCT),generic)
-copy_from := etc/vold.conf
+copy_from += etc/vold.conf
+endif
+
+# for non -user build, also copy emulator-support script into /system/etc
+ifneq ($(TARGET_BUILD_VARIANT),user)
+copy_from += etc/init.goldfish.sh
 endif
 
 copy_to := $(addprefix $(TARGET_OUT)/,$(copy_from))
@@ -32,11 +36,13 @@
 ALL_PREBUILT += $(file)
 endif
 
+# for non -user build, also copy emulator-specific init script into /
+ifneq ($(TARGET_BUILD_VARIANT),user)
 file := $(TARGET_ROOT_OUT)/init.goldfish.rc
 $(file) : $(LOCAL_PATH)/etc/init.goldfish.rc | $(ACP)
 	$(transform-prebuilt-to-target)
 ALL_PREBUILT += $(file)
-	
+endif
 
 # create some directories (some are mount points)
 DIRS := $(addprefix $(TARGET_ROOT_OUT)/, \