Loading edify/expr.c +1 −1 Original line number Diff line number Diff line Loading @@ -495,7 +495,7 @@ Value** ReadValueVarArgs(State* state, int argc, Expr* argv[]) { // Use printf-style arguments to compose an error message to put into // *state. Returns NULL. Value* ErrorAbort(State* state, char* format, ...) { Value* ErrorAbort(State* state, const char* format, ...) { char* buffer = malloc(4096); va_list v; va_start(v, format); Loading edify/expr.h +9 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,10 @@ #include "yydefs.h" #ifdef __cplusplus extern "C" { #endif #define MAX_STRING_LEN 1024 typedef struct Expr Expr; Loading Loading @@ -152,7 +156,7 @@ Value** ReadValueVarArgs(State* state, int argc, Expr* argv[]); // Use printf-style arguments to compose an error message to put into // *state. Returns NULL. Value* ErrorAbort(State* state, char* format, ...); Value* ErrorAbort(State* state, const char* format, ...) __attribute__((format(printf, 2, 3))); // Wrap a string into a Value, taking ownership of the string. Value* StringValue(char* str); Loading @@ -160,4 +164,8 @@ Value* StringValue(char* str); // Free a Value object. void FreeValue(Value* v); #ifdef __cplusplus } // extern "C" #endif #endif // _EXPRESSION_H install.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,8 @@ try_update_binary(const char *path, ZipArchive *zip, int* wipe_cache) { } } else if (strcmp(command, "wipe_cache") == 0) { *wipe_cache = 1; } else if (strcmp(command, "clear_display") == 0) { ui->SetBackground(RecoveryUI::NONE); } else { LOGE("unknown command [%s]\n", command); } Loading recovery.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ static const struct option OPTIONS[] = { { "wipe_data", no_argument, NULL, 'w' }, { "wipe_cache", no_argument, NULL, 'c' }, { "show_text", no_argument, NULL, 't' }, { "just_exit", no_argument, NULL, 'x' }, { NULL, 0, NULL, 0 }, }; Loading Loading @@ -81,6 +82,7 @@ RecoveryUI* ui = NULL; * --wipe_data - erase user data (and cache), then reboot * --wipe_cache - wipe cache (but not user data), then reboot * --set_encrypted_filesystem=on|off - enables / diasables encrypted fs * --just_exit - do nothing; exit and reboot * * After completing, we remove /cache/recovery/command and reboot. * Arguments may also be supplied in the bootloader control block (BCB). Loading Loading @@ -281,7 +283,7 @@ finish_recovery(const char *send_intent) { chmod(LAST_LOG_FILE, 0640); chmod(LAST_INSTALL_FILE, 0644); // Reset to mormal system boot so recovery won't cycle indefinitely. // Reset to normal system boot so recovery won't cycle indefinitely. struct bootloader_message boot; memset(&boot, 0, sizeof(boot)); set_bootloader_message(&boot); Loading Loading @@ -789,6 +791,7 @@ main(int argc, char **argv) { const char *send_intent = NULL; const char *update_package = NULL; int wipe_data = 0, wipe_cache = 0; bool just_exit = false; int arg; while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) { Loading @@ -799,6 +802,7 @@ main(int argc, char **argv) { case 'w': wipe_data = wipe_cache = 1; break; case 'c': wipe_cache = 1; break; case 't': ui->ShowText(true); break; case 'x': just_exit = true; break; case '?': LOGE("Invalid command argument\n"); continue; Loading Loading @@ -863,7 +867,7 @@ main(int argc, char **argv) { } else if (wipe_cache) { if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR; if (status != INSTALL_SUCCESS) ui->Print("Cache wipe failed.\n"); } else { } else if (!just_exit) { status = INSTALL_ERROR; // No command specified } Loading Loading
edify/expr.c +1 −1 Original line number Diff line number Diff line Loading @@ -495,7 +495,7 @@ Value** ReadValueVarArgs(State* state, int argc, Expr* argv[]) { // Use printf-style arguments to compose an error message to put into // *state. Returns NULL. Value* ErrorAbort(State* state, char* format, ...) { Value* ErrorAbort(State* state, const char* format, ...) { char* buffer = malloc(4096); va_list v; va_start(v, format); Loading
edify/expr.h +9 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,10 @@ #include "yydefs.h" #ifdef __cplusplus extern "C" { #endif #define MAX_STRING_LEN 1024 typedef struct Expr Expr; Loading Loading @@ -152,7 +156,7 @@ Value** ReadValueVarArgs(State* state, int argc, Expr* argv[]); // Use printf-style arguments to compose an error message to put into // *state. Returns NULL. Value* ErrorAbort(State* state, char* format, ...); Value* ErrorAbort(State* state, const char* format, ...) __attribute__((format(printf, 2, 3))); // Wrap a string into a Value, taking ownership of the string. Value* StringValue(char* str); Loading @@ -160,4 +164,8 @@ Value* StringValue(char* str); // Free a Value object. void FreeValue(Value* v); #ifdef __cplusplus } // extern "C" #endif #endif // _EXPRESSION_H
install.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,8 @@ try_update_binary(const char *path, ZipArchive *zip, int* wipe_cache) { } } else if (strcmp(command, "wipe_cache") == 0) { *wipe_cache = 1; } else if (strcmp(command, "clear_display") == 0) { ui->SetBackground(RecoveryUI::NONE); } else { LOGE("unknown command [%s]\n", command); } Loading
recovery.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ static const struct option OPTIONS[] = { { "wipe_data", no_argument, NULL, 'w' }, { "wipe_cache", no_argument, NULL, 'c' }, { "show_text", no_argument, NULL, 't' }, { "just_exit", no_argument, NULL, 'x' }, { NULL, 0, NULL, 0 }, }; Loading Loading @@ -81,6 +82,7 @@ RecoveryUI* ui = NULL; * --wipe_data - erase user data (and cache), then reboot * --wipe_cache - wipe cache (but not user data), then reboot * --set_encrypted_filesystem=on|off - enables / diasables encrypted fs * --just_exit - do nothing; exit and reboot * * After completing, we remove /cache/recovery/command and reboot. * Arguments may also be supplied in the bootloader control block (BCB). Loading Loading @@ -281,7 +283,7 @@ finish_recovery(const char *send_intent) { chmod(LAST_LOG_FILE, 0640); chmod(LAST_INSTALL_FILE, 0644); // Reset to mormal system boot so recovery won't cycle indefinitely. // Reset to normal system boot so recovery won't cycle indefinitely. struct bootloader_message boot; memset(&boot, 0, sizeof(boot)); set_bootloader_message(&boot); Loading Loading @@ -789,6 +791,7 @@ main(int argc, char **argv) { const char *send_intent = NULL; const char *update_package = NULL; int wipe_data = 0, wipe_cache = 0; bool just_exit = false; int arg; while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) { Loading @@ -799,6 +802,7 @@ main(int argc, char **argv) { case 'w': wipe_data = wipe_cache = 1; break; case 'c': wipe_cache = 1; break; case 't': ui->ShowText(true); break; case 'x': just_exit = true; break; case '?': LOGE("Invalid command argument\n"); continue; Loading Loading @@ -863,7 +867,7 @@ main(int argc, char **argv) { } else if (wipe_cache) { if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR; if (status != INSTALL_SUCCESS) ui->Print("Cache wipe failed.\n"); } else { } else if (!just_exit) { status = INSTALL_ERROR; // No command specified } Loading