OSDN Git Service

android: fix 64-bit targets building errors
authorMauro Rossi <issor.oruam@gmail.com>
Tue, 22 Dec 2015 00:41:09 +0000 (01:41 +0100)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 22 Dec 2015 06:48:34 +0000 (14:48 +0800)
Patch to avoid the following building errors:

Import includes file: out/target/product/x86_64/obj/EXECUTABLES/su_intermediates/import_includes
target  C: su <= external/koush/Superuser/Superuser/jni/su/su.c
external/koush/Superuser/Superuser/jni/su/su.c: In function 'socket_send_request':
external/koush/Superuser/Superuser/jni/su/su.c:397:5: error: implicit declaration of function 'htonl' [-Werror=implicit-function-declaration]
     write_token(fd, "version", PROTO_VERSION);
     ^

target  C: su <= external/koush/Superuser/Superuser/jni/su/pts.c
Export includes file: external/koush/Superuser/Android.mk -- out/target/product/x86_64/obj/EXECUTABLES/su_intermediates/export_includes
target Prebuilt: clatd.conf (out/target/product/x86_64/obj/ETC/clatd.conf_intermediates/clatd.conf)
external/koush/Superuser/Superuser/jni/su/pts.c: In function 'pts_open':
external/koush/Superuser/Superuser/jni/su/pts.c:121:5: error: implicit declaration of function 'strncpy' [-Werror=implicit-function-declaration]
     strncpy(slave_name, sn_tmp, slave_name_size);
     ^

Superuser/jni/su/pts.c
Superuser/jni/su/su.c

index 8e96541..ee83064 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <signal.h>
index be25e7e..da7b84f 100644 (file)
@@ -33,6 +33,7 @@
 #include <sys/stat.h>
 #include <stdarg.h>
 #include <sys/types.h>
+#include <sys/endian.h>
 
 #include "su.h"
 #include "utils.h"