Fix clang warnings in core/jni.
There are a few bugs in here too (mostly people expecting + to
concatenate C strings) :(
Change-Id: I0a243c05c4ea8b56e84896f37814d0fbea4c39d5
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 69d9387..c645e30 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -20,12 +20,12 @@
#include <sys/mount.h>
#include <linux/fs.h>
-#include <grp.h>
#include <fcntl.h>
+#include <grp.h>
+#include <inttypes.h>
#include <paths.h>
#include <signal.h>
#include <stdlib.h>
-#include <unistd.h>
#include <sys/capability.h>
#include <sys/personality.h>
#include <sys/prctl.h>
@@ -34,7 +34,7 @@
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/wait.h>
-
+#include <unistd.h>
#include <cutils/fs.h>
#include <cutils/multiuser.h>
@@ -104,7 +104,7 @@
// so that it is restarted by init and system server will be restarted
// from there.
if (pid == gSystemServerPid) {
- ALOGE("Exit zygote because system server (%d) has terminated");
+ ALOGE("Exit zygote because system server (%d) has terminated", pid);
kill(getpid(), SIGKILL);
}
}
@@ -189,7 +189,8 @@
int rc = setrlimit(javaRlimit[0], &rlim);
if (rc == -1) {
- ALOGE("setrlimit(%d, {%d, %d}) failed", javaRlimit[0], rlim.rlim_cur, rlim.rlim_max);
+ ALOGE("setrlimit(%d, {%ld, %ld}) failed", javaRlimit[0], rlim.rlim_cur,
+ rlim.rlim_max);
RuntimeAbort(env);
}
}
@@ -235,7 +236,7 @@
capdata[1].permitted = permitted >> 32;
if (capset(&capheader, &capdata[0]) == -1) {
- ALOGE("capset(%lld, %lld) failed", permitted, effective);
+ ALOGE("capset(%" PRId64 ", %" PRId64 ") failed", permitted, effective);
RuntimeAbort(env);
}
}