am cbbb83b0: Fix implicit declaration of function \'prctl\' in adb.

* commit 'cbbb83b0eb8b09b729c9287238d709bec7b833b5':
  Fix implicit declaration of function 'prctl' in adb.
diff --git a/debuggerd/utility.cpp b/debuggerd/utility.cpp
index a163344..9a30fe3 100644
--- a/debuggerd/utility.cpp
+++ b/debuggerd/utility.cpp
@@ -59,6 +59,8 @@
 void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) {
   bool write_to_tombstone = (log->tfd != -1);
   bool write_to_logcat = is_allowed_in_logcat(ltype)
+                      && log->crashed_tid != -1
+                      && log->current_tid != -1
                       && (log->crashed_tid == log->current_tid);
   bool write_to_activitymanager = (log->amfd != -1);
 
diff --git a/debuggerd/utility.h b/debuggerd/utility.h
index 518305d..31684ce 100644
--- a/debuggerd/utility.h
+++ b/debuggerd/utility.h
@@ -37,7 +37,7 @@
 #endif
 
 
-typedef struct {
+struct log_t{
     /* tombstone file descriptor */
     int tfd;
     /* Activity Manager socket file descriptor */
@@ -46,7 +46,10 @@
     pid_t crashed_tid;
     // The tid of the thread we are currently working with.
     pid_t current_tid;
-} log_t;
+
+    log_t()
+        : tfd(-1), amfd(-1), crashed_tid(-1), current_tid(-1) {}
+};
 
 // List of types of logs to simplify the logging decision in _LOG
 enum logtype {
diff --git a/include/cutils/jstring.h b/include/cutils/jstring.h
index ee0018f..a342608 100644
--- a/include/cutils/jstring.h
+++ b/include/cutils/jstring.h
@@ -24,7 +24,10 @@
 extern "C" {
 #endif
 
-typedef uint16_t char16_t;
+#if __STDC_VERSION__ < 201112L && __cplusplus < 201103L
+  typedef uint16_t char16_t;
+#endif
+  // otherwise char16_t is a keyword with the right semantics
 
 extern char * strndup16to8 (const char16_t* s, size_t n);
 extern size_t strnlen16to8 (const char16_t* s, size_t n);
diff --git a/logd/main.cpp b/logd/main.cpp
index ece5a3a..1e1a718 100644
--- a/logd/main.cpp
+++ b/logd/main.cpp
@@ -22,12 +22,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/capability.h>
+#include <sys/prctl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <linux/prctl.h>
-
 #include <cutils/properties.h>
 
 #include "private/android_filesystem_config.h"
diff --git a/rootdir/init.rc b/rootdir/init.rc
index bbce64f..8eef76b 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -184,11 +184,12 @@
     # issued fs triggers have completed.
     trigger load_all_props_action
 
+    # Remove a file to wake up anything waiting for firmware.
+    trigger firmware_mounts_complete
+
     trigger early-boot
     trigger boot
 
-    # Remove a file to wake up anything waiting for firmware
-    trigger firmware_mounts_complete
 
 on post-fs
     # once everything is setup, no need to modify /