aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk6
-rw-r--r--adb_install.cpp2
-rw-r--r--applypatch/Android.mk5
-rw-r--r--edify/Android.mk2
-rw-r--r--minadbd/Android.mk1
-rw-r--r--minui/Android.mk1
-rw-r--r--minzip/Android.mk2
-rw-r--r--minzip/Zip.c2
-rw-r--r--mtdutils/Android.mk2
-rw-r--r--recovery.cpp21
-rw-r--r--tests/Android.mk1
-rw-r--r--uncrypt/Android.mk2
-rw-r--r--updater/Android.mk2
13 files changed, 38 insertions, 11 deletions
diff --git a/Android.mk b/Android.mk
index 3bcbeab0..cfe30308 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,11 +14,10 @@
14 14
15LOCAL_PATH := $(call my-dir) 15LOCAL_PATH := $(call my-dir)
16 16
17
18include $(CLEAR_VARS) 17include $(CLEAR_VARS)
19 18
20LOCAL_SRC_FILES := fuse_sideload.c 19LOCAL_SRC_FILES := fuse_sideload.c
21 20LOCAL_CLANG := true
22LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter 21LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter
23LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE 22LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
24 23
@@ -54,6 +53,7 @@ RECOVERY_API_VERSION := 3
54RECOVERY_FSTAB_VERSION := 2 53RECOVERY_FSTAB_VERSION := 2
55LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) 54LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
56LOCAL_CFLAGS += -Wno-unused-parameter 55LOCAL_CFLAGS += -Wno-unused-parameter
56LOCAL_CLANG := true
57 57
58LOCAL_C_INCLUDES += \ 58LOCAL_C_INCLUDES += \
59 system/vold \ 59 system/vold \
@@ -97,6 +97,7 @@ include $(BUILD_EXECUTABLE)
97 97
98# All the APIs for testing 98# All the APIs for testing
99include $(CLEAR_VARS) 99include $(CLEAR_VARS)
100LOCAL_CLANG := true
100LOCAL_MODULE := libverifier 101LOCAL_MODULE := libverifier
101LOCAL_MODULE_TAGS := tests 102LOCAL_MODULE_TAGS := tests
102LOCAL_SRC_FILES := \ 103LOCAL_SRC_FILES := \
@@ -104,6 +105,7 @@ LOCAL_SRC_FILES := \
104include $(BUILD_STATIC_LIBRARY) 105include $(BUILD_STATIC_LIBRARY)
105 106
106include $(CLEAR_VARS) 107include $(CLEAR_VARS)
108LOCAL_CLANG := true
107LOCAL_MODULE := verifier_test 109LOCAL_MODULE := verifier_test
108LOCAL_FORCE_STATIC_EXECUTABLE := true 110LOCAL_FORCE_STATIC_EXECUTABLE := true
109LOCAL_MODULE_TAGS := tests 111LOCAL_MODULE_TAGS := tests
diff --git a/adb_install.cpp b/adb_install.cpp
index e3b94ea5..4cfcb2ab 100644
--- a/adb_install.cpp
+++ b/adb_install.cpp
@@ -91,7 +91,7 @@ apply_from_adb(RecoveryUI* ui_, bool* wipe_cache, const char* install_file) {
91 // FUSE_SIDELOAD_HOST_PATHNAME will start to exist once the host 91 // FUSE_SIDELOAD_HOST_PATHNAME will start to exist once the host
92 // connects and starts serving a package. Poll for its 92 // connects and starts serving a package. Poll for its
93 // appearance. (Note that inotify doesn't work with FUSE.) 93 // appearance. (Note that inotify doesn't work with FUSE.)
94 int result; 94 int result = INSTALL_ERROR;
95 int status; 95 int status;
96 bool waited = false; 96 bool waited = false;
97 struct stat st; 97 struct stat st;
diff --git a/applypatch/Android.mk b/applypatch/Android.mk
index 861edd24..eb3e4580 100644
--- a/applypatch/Android.mk
+++ b/applypatch/Android.mk
@@ -13,8 +13,10 @@
13# limitations under the License. 13# limitations under the License.
14 14
15LOCAL_PATH := $(call my-dir) 15LOCAL_PATH := $(call my-dir)
16
16include $(CLEAR_VARS) 17include $(CLEAR_VARS)
17 18
19LOCAL_CLANG := true
18LOCAL_SRC_FILES := applypatch.c bspatch.c freecache.c imgpatch.c utils.c 20LOCAL_SRC_FILES := applypatch.c bspatch.c freecache.c imgpatch.c utils.c
19LOCAL_MODULE := libapplypatch 21LOCAL_MODULE := libapplypatch
20LOCAL_MODULE_TAGS := eng 22LOCAL_MODULE_TAGS := eng
@@ -25,6 +27,7 @@ include $(BUILD_STATIC_LIBRARY)
25 27
26include $(CLEAR_VARS) 28include $(CLEAR_VARS)
27 29
30LOCAL_CLANG := true
28LOCAL_SRC_FILES := main.c 31LOCAL_SRC_FILES := main.c
29LOCAL_MODULE := applypatch 32LOCAL_MODULE := applypatch
30LOCAL_C_INCLUDES += bootable/recovery 33LOCAL_C_INCLUDES += bootable/recovery
@@ -35,6 +38,7 @@ include $(BUILD_EXECUTABLE)
35 38
36include $(CLEAR_VARS) 39include $(CLEAR_VARS)
37 40
41LOCAL_CLANG := true
38LOCAL_SRC_FILES := main.c 42LOCAL_SRC_FILES := main.c
39LOCAL_MODULE := applypatch_static 43LOCAL_MODULE := applypatch_static
40LOCAL_FORCE_STATIC_EXECUTABLE := true 44LOCAL_FORCE_STATIC_EXECUTABLE := true
@@ -47,6 +51,7 @@ include $(BUILD_EXECUTABLE)
47 51
48include $(CLEAR_VARS) 52include $(CLEAR_VARS)
49 53
54LOCAL_CLANG := true
50LOCAL_SRC_FILES := imgdiff.c utils.c bsdiff.c 55LOCAL_SRC_FILES := imgdiff.c utils.c bsdiff.c
51LOCAL_MODULE := imgdiff 56LOCAL_MODULE := imgdiff
52LOCAL_FORCE_STATIC_EXECUTABLE := true 57LOCAL_FORCE_STATIC_EXECUTABLE := true
diff --git a/edify/Android.mk b/edify/Android.mk
index 03c04e43..c3664504 100644
--- a/edify/Android.mk
+++ b/edify/Android.mk
@@ -25,6 +25,7 @@ LOCAL_CFLAGS := $(edify_cflags) -g -O0
25LOCAL_MODULE := edify 25LOCAL_MODULE := edify
26LOCAL_YACCFLAGS := -v 26LOCAL_YACCFLAGS := -v
27LOCAL_CFLAGS += -Wno-unused-parameter 27LOCAL_CFLAGS += -Wno-unused-parameter
28LOCAL_CLANG := true
28 29
29include $(BUILD_HOST_EXECUTABLE) 30include $(BUILD_HOST_EXECUTABLE)
30 31
@@ -38,5 +39,6 @@ LOCAL_SRC_FILES := $(edify_src_files)
38LOCAL_CFLAGS := $(edify_cflags) 39LOCAL_CFLAGS := $(edify_cflags)
39LOCAL_CFLAGS += -Wno-unused-parameter 40LOCAL_CFLAGS += -Wno-unused-parameter
40LOCAL_MODULE := libedify 41LOCAL_MODULE := libedify
42LOCAL_CLANG := true
41 43
42include $(BUILD_STATIC_LIBRARY) 44include $(BUILD_STATIC_LIBRARY)
diff --git a/minadbd/Android.mk b/minadbd/Android.mk
index a7a3e087..3db3b411 100644
--- a/minadbd/Android.mk
+++ b/minadbd/Android.mk
@@ -15,6 +15,7 @@ LOCAL_SRC_FILES := \
15 fuse_adb_provider.cpp \ 15 fuse_adb_provider.cpp \
16 services.cpp \ 16 services.cpp \
17 17
18LOCAL_CLANG := true
18LOCAL_MODULE := libminadbd 19LOCAL_MODULE := libminadbd
19LOCAL_CFLAGS := $(minadbd_cflags) 20LOCAL_CFLAGS := $(minadbd_cflags)
20LOCAL_CONLY_FLAGS := -Wimplicit-function-declaration 21LOCAL_CONLY_FLAGS := -Wimplicit-function-declaration
diff --git a/minui/Android.mk b/minui/Android.mk
index 52f06625..5584612d 100644
--- a/minui/Android.mk
+++ b/minui/Android.mk
@@ -39,6 +39,7 @@ include $(BUILD_STATIC_LIBRARY)
39 39
40# Used by OEMs for factory test images. 40# Used by OEMs for factory test images.
41include $(CLEAR_VARS) 41include $(CLEAR_VARS)
42LOCAL_CLANG := true
42LOCAL_MODULE := libminui 43LOCAL_MODULE := libminui
43LOCAL_WHOLE_STATIC_LIBRARIES += libminui 44LOCAL_WHOLE_STATIC_LIBRARIES += libminui
44LOCAL_SHARED_LIBRARIES := libpng 45LOCAL_SHARED_LIBRARIES := libpng
diff --git a/minzip/Android.mk b/minzip/Android.mk
index 045f3557..48d26bcb 100644
--- a/minzip/Android.mk
+++ b/minzip/Android.mk
@@ -16,6 +16,8 @@ LOCAL_STATIC_LIBRARIES := libselinux
16 16
17LOCAL_MODULE := libminzip 17LOCAL_MODULE := libminzip
18 18
19LOCAL_CLANG := true
20
19LOCAL_CFLAGS += -Wall 21LOCAL_CFLAGS += -Wall
20 22
21include $(BUILD_STATIC_LIBRARY) 23include $(BUILD_STATIC_LIBRARY)
diff --git a/minzip/Zip.c b/minzip/Zip.c
index 40712e03..a64c833f 100644
--- a/minzip/Zip.c
+++ b/minzip/Zip.c
@@ -506,7 +506,6 @@ static bool processDeflatedEntry(const ZipArchive *pArchive,
506 void *cookie) 506 void *cookie)
507{ 507{
508 long result = -1; 508 long result = -1;
509 unsigned char readBuf[32 * 1024];
510 unsigned char procBuf[32 * 1024]; 509 unsigned char procBuf[32 * 1024];
511 z_stream zstream; 510 z_stream zstream;
512 int zerr; 511 int zerr;
@@ -603,7 +602,6 @@ bool mzProcessZipEntryContents(const ZipArchive *pArchive,
603 void *cookie) 602 void *cookie)
604{ 603{
605 bool ret = false; 604 bool ret = false;
606 off_t oldOff;
607 605
608 switch (pEntry->compression) { 606 switch (pEntry->compression) {
609 case STORED: 607 case STORED:
diff --git a/mtdutils/Android.mk b/mtdutils/Android.mk
index f04355b5..b7d35c27 100644
--- a/mtdutils/Android.mk
+++ b/mtdutils/Android.mk
@@ -6,10 +6,12 @@ LOCAL_SRC_FILES := \
6 mounts.c 6 mounts.c
7 7
8LOCAL_MODULE := libmtdutils 8LOCAL_MODULE := libmtdutils
9LOCAL_CLANG := true
9 10
10include $(BUILD_STATIC_LIBRARY) 11include $(BUILD_STATIC_LIBRARY)
11 12
12include $(CLEAR_VARS) 13include $(CLEAR_VARS)
14LOCAL_CLANG := true
13LOCAL_SRC_FILES := flash_image.c 15LOCAL_SRC_FILES := flash_image.c
14LOCAL_MODULE := flash_image 16LOCAL_MODULE := flash_image
15LOCAL_MODULE_TAGS := eng 17LOCAL_MODULE_TAGS := eng
diff --git a/recovery.cpp b/recovery.cpp
index bfc68950..76149cd9 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -326,14 +326,18 @@ static void rotate_logs(int max) {
326 ensure_path_mounted(LAST_KMSG_FILE); 326 ensure_path_mounted(LAST_KMSG_FILE);
327 327
328 for (int i = max-1; i >= 0; --i) { 328 for (int i = max-1; i >= 0; --i) {
329 std::string old_log = android::base::StringPrintf((i == 0) ? "%s" : "%s.%d", 329 std::string old_log = android::base::StringPrintf("%s", LAST_LOG_FILE);
330 LAST_LOG_FILE, i); 330 if (i > 0) {
331 old_log += "." + std::to_string(i);
332 }
331 std::string new_log = android::base::StringPrintf("%s.%d", LAST_LOG_FILE, i+1); 333 std::string new_log = android::base::StringPrintf("%s.%d", LAST_LOG_FILE, i+1);
332 // Ignore errors if old_log doesn't exist. 334 // Ignore errors if old_log doesn't exist.
333 rename(old_log.c_str(), new_log.c_str()); 335 rename(old_log.c_str(), new_log.c_str());
334 336
335 std::string old_kmsg = android::base::StringPrintf((i == 0) ? "%s" : "%s.%d", 337 std::string old_kmsg = android::base::StringPrintf("%s", LAST_KMSG_FILE);
336 LAST_KMSG_FILE, i); 338 if (i > 0) {
339 old_kmsg += "." + std::to_string(i);
340 }
337 std::string new_kmsg = android::base::StringPrintf("%s.%d", LAST_KMSG_FILE, i+1); 341 std::string new_kmsg = android::base::StringPrintf("%s.%d", LAST_KMSG_FILE, i+1);
338 rename(old_kmsg.c_str(), new_kmsg.c_str()); 342 rename(old_kmsg.c_str(), new_kmsg.c_str());
339 } 343 }
@@ -711,7 +715,10 @@ static void choose_recovery_file(Device* device) {
711 // Add LAST_KMSG_FILE + LAST_KMSG_FILE.x 715 // Add LAST_KMSG_FILE + LAST_KMSG_FILE.x
712 for (int i = 0; i < KEEP_LOG_COUNT; i++) { 716 for (int i = 0; i < KEEP_LOG_COUNT; i++) {
713 char* log_file; 717 char* log_file;
714 if (asprintf(&log_file, (i == 0) ? "%s" : "%s.%d", LAST_LOG_FILE, i) == -1) { 718 int ret;
719 ret = (i == 0) ? asprintf(&log_file, "%s", LAST_LOG_FILE) :
720 asprintf(&log_file, "%s.%d", LAST_LOG_FILE, i);
721 if (ret == -1) {
715 // memory allocation failure - return early. Should never happen. 722 // memory allocation failure - return early. Should never happen.
716 return; 723 return;
717 } 724 }
@@ -722,7 +729,9 @@ static void choose_recovery_file(Device* device) {
722 } 729 }
723 730
724 char* kmsg_file; 731 char* kmsg_file;
725 if (asprintf(&kmsg_file, (i == 0) ? "%s" : "%s.%d", LAST_KMSG_FILE, i) == -1) { 732 ret = (i == 0) ? asprintf(&kmsg_file, "%s", LAST_KMSG_FILE) :
733 asprintf(&kmsg_file, "%s.%d", LAST_KMSG_FILE, i);
734 if (ret == -1) {
726 // memory allocation failure - return early. Should never happen. 735 // memory allocation failure - return early. Should never happen.
727 return; 736 return;
728 } 737 }
diff --git a/tests/Android.mk b/tests/Android.mk
index 02a272a2..4ce00b45 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -17,6 +17,7 @@
17LOCAL_PATH := $(call my-dir) 17LOCAL_PATH := $(call my-dir)
18 18
19include $(CLEAR_VARS) 19include $(CLEAR_VARS)
20LOCAL_CLANG := true
20LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 21LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
21LOCAL_STATIC_LIBRARIES := libverifier 22LOCAL_STATIC_LIBRARIES := libverifier
22LOCAL_SRC_FILES := asn1_decoder_test.cpp 23LOCAL_SRC_FILES := asn1_decoder_test.cpp
diff --git a/uncrypt/Android.mk b/uncrypt/Android.mk
index d832d972..6859e75e 100644
--- a/uncrypt/Android.mk
+++ b/uncrypt/Android.mk
@@ -16,6 +16,8 @@ LOCAL_PATH := $(call my-dir)
16 16
17include $(CLEAR_VARS) 17include $(CLEAR_VARS)
18 18
19LOCAL_CLANG := true
20
19LOCAL_SRC_FILES := uncrypt.cpp 21LOCAL_SRC_FILES := uncrypt.cpp
20 22
21LOCAL_MODULE := uncrypt 23LOCAL_MODULE := uncrypt
diff --git a/updater/Android.mk b/updater/Android.mk
index 57f43da9..a0ea06fa 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -17,6 +17,8 @@ include $(CLEAR_VARS)
17# needed only for OTA packages.) 17# needed only for OTA packages.)
18LOCAL_MODULE_TAGS := eng 18LOCAL_MODULE_TAGS := eng
19 19
20LOCAL_CLANG := true
21
20LOCAL_SRC_FILES := $(updater_src_files) 22LOCAL_SRC_FILES := $(updater_src_files)
21 23
22ifeq ($(TARGET_USERIMAGES_USE_EXT4), true) 24ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)