diff options
-rw-r--r-- | Android.mk | 6 | ||||
-rw-r--r-- | adb_install.cpp | 2 | ||||
-rw-r--r-- | applypatch/Android.mk | 5 | ||||
-rw-r--r-- | edify/Android.mk | 2 | ||||
-rw-r--r-- | minadbd/Android.mk | 1 | ||||
-rw-r--r-- | minui/Android.mk | 1 | ||||
-rw-r--r-- | minzip/Android.mk | 2 | ||||
-rw-r--r-- | minzip/Zip.c | 2 | ||||
-rw-r--r-- | mtdutils/Android.mk | 2 | ||||
-rw-r--r-- | recovery.cpp | 21 | ||||
-rw-r--r-- | tests/Android.mk | 1 | ||||
-rw-r--r-- | uncrypt/Android.mk | 2 | ||||
-rw-r--r-- | updater/Android.mk | 2 |
13 files changed, 38 insertions, 11 deletions
@@ -14,11 +14,10 @@ | |||
14 | 14 | ||
15 | LOCAL_PATH := $(call my-dir) | 15 | LOCAL_PATH := $(call my-dir) |
16 | 16 | ||
17 | |||
18 | include $(CLEAR_VARS) | 17 | include $(CLEAR_VARS) |
19 | 18 | ||
20 | LOCAL_SRC_FILES := fuse_sideload.c | 19 | LOCAL_SRC_FILES := fuse_sideload.c |
21 | 20 | LOCAL_CLANG := true | |
22 | LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter | 21 | LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter |
23 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE | 22 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE |
24 | 23 | ||
@@ -54,6 +53,7 @@ RECOVERY_API_VERSION := 3 | |||
54 | RECOVERY_FSTAB_VERSION := 2 | 53 | RECOVERY_FSTAB_VERSION := 2 |
55 | LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) | 54 | LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) |
56 | LOCAL_CFLAGS += -Wno-unused-parameter | 55 | LOCAL_CFLAGS += -Wno-unused-parameter |
56 | LOCAL_CLANG := true | ||
57 | 57 | ||
58 | LOCAL_C_INCLUDES += \ | 58 | LOCAL_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 |
99 | include $(CLEAR_VARS) | 99 | include $(CLEAR_VARS) |
100 | LOCAL_CLANG := true | ||
100 | LOCAL_MODULE := libverifier | 101 | LOCAL_MODULE := libverifier |
101 | LOCAL_MODULE_TAGS := tests | 102 | LOCAL_MODULE_TAGS := tests |
102 | LOCAL_SRC_FILES := \ | 103 | LOCAL_SRC_FILES := \ |
@@ -104,6 +105,7 @@ LOCAL_SRC_FILES := \ | |||
104 | include $(BUILD_STATIC_LIBRARY) | 105 | include $(BUILD_STATIC_LIBRARY) |
105 | 106 | ||
106 | include $(CLEAR_VARS) | 107 | include $(CLEAR_VARS) |
108 | LOCAL_CLANG := true | ||
107 | LOCAL_MODULE := verifier_test | 109 | LOCAL_MODULE := verifier_test |
108 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 110 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
109 | LOCAL_MODULE_TAGS := tests | 111 | LOCAL_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 | ||
15 | LOCAL_PATH := $(call my-dir) | 15 | LOCAL_PATH := $(call my-dir) |
16 | |||
16 | include $(CLEAR_VARS) | 17 | include $(CLEAR_VARS) |
17 | 18 | ||
19 | LOCAL_CLANG := true | ||
18 | LOCAL_SRC_FILES := applypatch.c bspatch.c freecache.c imgpatch.c utils.c | 20 | LOCAL_SRC_FILES := applypatch.c bspatch.c freecache.c imgpatch.c utils.c |
19 | LOCAL_MODULE := libapplypatch | 21 | LOCAL_MODULE := libapplypatch |
20 | LOCAL_MODULE_TAGS := eng | 22 | LOCAL_MODULE_TAGS := eng |
@@ -25,6 +27,7 @@ include $(BUILD_STATIC_LIBRARY) | |||
25 | 27 | ||
26 | include $(CLEAR_VARS) | 28 | include $(CLEAR_VARS) |
27 | 29 | ||
30 | LOCAL_CLANG := true | ||
28 | LOCAL_SRC_FILES := main.c | 31 | LOCAL_SRC_FILES := main.c |
29 | LOCAL_MODULE := applypatch | 32 | LOCAL_MODULE := applypatch |
30 | LOCAL_C_INCLUDES += bootable/recovery | 33 | LOCAL_C_INCLUDES += bootable/recovery |
@@ -35,6 +38,7 @@ include $(BUILD_EXECUTABLE) | |||
35 | 38 | ||
36 | include $(CLEAR_VARS) | 39 | include $(CLEAR_VARS) |
37 | 40 | ||
41 | LOCAL_CLANG := true | ||
38 | LOCAL_SRC_FILES := main.c | 42 | LOCAL_SRC_FILES := main.c |
39 | LOCAL_MODULE := applypatch_static | 43 | LOCAL_MODULE := applypatch_static |
40 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 44 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
@@ -47,6 +51,7 @@ include $(BUILD_EXECUTABLE) | |||
47 | 51 | ||
48 | include $(CLEAR_VARS) | 52 | include $(CLEAR_VARS) |
49 | 53 | ||
54 | LOCAL_CLANG := true | ||
50 | LOCAL_SRC_FILES := imgdiff.c utils.c bsdiff.c | 55 | LOCAL_SRC_FILES := imgdiff.c utils.c bsdiff.c |
51 | LOCAL_MODULE := imgdiff | 56 | LOCAL_MODULE := imgdiff |
52 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 57 | LOCAL_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 | |||
25 | LOCAL_MODULE := edify | 25 | LOCAL_MODULE := edify |
26 | LOCAL_YACCFLAGS := -v | 26 | LOCAL_YACCFLAGS := -v |
27 | LOCAL_CFLAGS += -Wno-unused-parameter | 27 | LOCAL_CFLAGS += -Wno-unused-parameter |
28 | LOCAL_CLANG := true | ||
28 | 29 | ||
29 | include $(BUILD_HOST_EXECUTABLE) | 30 | include $(BUILD_HOST_EXECUTABLE) |
30 | 31 | ||
@@ -38,5 +39,6 @@ LOCAL_SRC_FILES := $(edify_src_files) | |||
38 | LOCAL_CFLAGS := $(edify_cflags) | 39 | LOCAL_CFLAGS := $(edify_cflags) |
39 | LOCAL_CFLAGS += -Wno-unused-parameter | 40 | LOCAL_CFLAGS += -Wno-unused-parameter |
40 | LOCAL_MODULE := libedify | 41 | LOCAL_MODULE := libedify |
42 | LOCAL_CLANG := true | ||
41 | 43 | ||
42 | include $(BUILD_STATIC_LIBRARY) | 44 | include $(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 | ||
18 | LOCAL_CLANG := true | ||
18 | LOCAL_MODULE := libminadbd | 19 | LOCAL_MODULE := libminadbd |
19 | LOCAL_CFLAGS := $(minadbd_cflags) | 20 | LOCAL_CFLAGS := $(minadbd_cflags) |
20 | LOCAL_CONLY_FLAGS := -Wimplicit-function-declaration | 21 | LOCAL_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. |
41 | include $(CLEAR_VARS) | 41 | include $(CLEAR_VARS) |
42 | LOCAL_CLANG := true | ||
42 | LOCAL_MODULE := libminui | 43 | LOCAL_MODULE := libminui |
43 | LOCAL_WHOLE_STATIC_LIBRARIES += libminui | 44 | LOCAL_WHOLE_STATIC_LIBRARIES += libminui |
44 | LOCAL_SHARED_LIBRARIES := libpng | 45 | LOCAL_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 | ||
17 | LOCAL_MODULE := libminzip | 17 | LOCAL_MODULE := libminzip |
18 | 18 | ||
19 | LOCAL_CLANG := true | ||
20 | |||
19 | LOCAL_CFLAGS += -Wall | 21 | LOCAL_CFLAGS += -Wall |
20 | 22 | ||
21 | include $(BUILD_STATIC_LIBRARY) | 23 | include $(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 | ||
8 | LOCAL_MODULE := libmtdutils | 8 | LOCAL_MODULE := libmtdutils |
9 | LOCAL_CLANG := true | ||
9 | 10 | ||
10 | include $(BUILD_STATIC_LIBRARY) | 11 | include $(BUILD_STATIC_LIBRARY) |
11 | 12 | ||
12 | include $(CLEAR_VARS) | 13 | include $(CLEAR_VARS) |
14 | LOCAL_CLANG := true | ||
13 | LOCAL_SRC_FILES := flash_image.c | 15 | LOCAL_SRC_FILES := flash_image.c |
14 | LOCAL_MODULE := flash_image | 16 | LOCAL_MODULE := flash_image |
15 | LOCAL_MODULE_TAGS := eng | 17 | LOCAL_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 @@ | |||
17 | LOCAL_PATH := $(call my-dir) | 17 | LOCAL_PATH := $(call my-dir) |
18 | 18 | ||
19 | include $(CLEAR_VARS) | 19 | include $(CLEAR_VARS) |
20 | LOCAL_CLANG := true | ||
20 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk | 21 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
21 | LOCAL_STATIC_LIBRARIES := libverifier | 22 | LOCAL_STATIC_LIBRARIES := libverifier |
22 | LOCAL_SRC_FILES := asn1_decoder_test.cpp | 23 | LOCAL_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 | ||
17 | include $(CLEAR_VARS) | 17 | include $(CLEAR_VARS) |
18 | 18 | ||
19 | LOCAL_CLANG := true | ||
20 | |||
19 | LOCAL_SRC_FILES := uncrypt.cpp | 21 | LOCAL_SRC_FILES := uncrypt.cpp |
20 | 22 | ||
21 | LOCAL_MODULE := uncrypt | 23 | LOCAL_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.) |
18 | LOCAL_MODULE_TAGS := eng | 18 | LOCAL_MODULE_TAGS := eng |
19 | 19 | ||
20 | LOCAL_CLANG := true | ||
21 | |||
20 | LOCAL_SRC_FILES := $(updater_src_files) | 22 | LOCAL_SRC_FILES := $(updater_src_files) |
21 | 23 | ||
22 | ifeq ($(TARGET_USERIMAGES_USE_EXT4), true) | 24 | ifeq ($(TARGET_USERIMAGES_USE_EXT4), true) |