Merge "Add close_file flag to OpenArchiveFd()"
diff --git a/adf/libadf/adf.c b/adf/libadf/adf.c
index 1d19152..66c329c 100644
--- a/adf/libadf/adf.c
+++ b/adf/libadf/adf.c
@@ -17,9 +17,11 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <malloc.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <linux/limits.h>
 
diff --git a/init/builtins.c b/init/builtins.c
index 5d2a517..d42ec81 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <sys/mount.h>
 #include <sys/resource.h>
+#include <sys/time.h>
 #include <sys/wait.h>
 #include <linux/loop.h>
 #include <cutils/partition_utils.h>
diff --git a/init/watchdogd.c b/init/watchdogd.c
index fb53836..7f64fc4 100644
--- a/init/watchdogd.c
+++ b/init/watchdogd.c
@@ -18,6 +18,7 @@
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <linux/watchdog.h>
 
diff --git a/rootdir/init.rc b/rootdir/init.rc
index dcdc658..2ae7409 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -290,6 +290,7 @@
     mkdir /data/app-lib 0771 system system
     mkdir /data/app 0771 system system
     mkdir /data/property 0700 root root
+    mkdir /data/tombstones 0771 system system
 
     # create dalvik-cache, so as to enforce our permissions
     mkdir /data/dalvik-cache 0771 root root
diff --git a/toolbox/ps.c b/toolbox/ps.c
index 7d6dfa0..d0a8db3 100644
--- a/toolbox/ps.c
+++ b/toolbox/ps.c
@@ -30,6 +30,7 @@
 #define SHOW_ABI 64
 
 static int display_flags = 0;
+static int ppid_filter = 0;
 
 static void print_exe_abi(int pid);
 
@@ -145,6 +146,10 @@
         strcpy(user,pw->pw_name);
     }
 
+    if(ppid_filter != 0 && ppid != ppid_filter) {
+        return 0;
+    }
+
     if(!namefilter || !strncmp(cmdline[0] ? cmdline : name, namefilter, strlen(namefilter))) {
         if (display_flags & SHOW_MACLABEL) {
             fd = open(macline, O_RDONLY);
@@ -266,6 +271,10 @@
             display_flags |= SHOW_CPU;
         } else if(!strcmp(argv[1],"--abi")) {
             display_flags |= SHOW_ABI;
+        } else if(!strcmp(argv[1],"--ppid")) {
+            ppid_filter = atoi(argv[2]);
+            argc--;
+            argv++;
         } else if(isdigit(argv[1][0])){
             pidfilter = atoi(argv[1]);
         } else {