summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-02-04 00:53:26 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-02-04 00:53:26 +0100
commit94720ced1a42fac53ebb4ca028719bd7251dc863 (patch)
treeeb7876bf60c6c00b29aaa30c6679642907b39032
parentMerge "Avoid to call UI functions in child process" am: 0f275ae56e am: 5fa2e576f9 am: 15ab95bb63 (diff)
parentMerge "Replace _exit(-1) with _exit(EXIT_FAILURE)." am: 95bcbfdd4e am: 80176c68b2 (diff)
downloadandroid_bootable_recovery-94720ced1a42fac53ebb4ca028719bd7251dc863.tar
android_bootable_recovery-94720ced1a42fac53ebb4ca028719bd7251dc863.tar.gz
android_bootable_recovery-94720ced1a42fac53ebb4ca028719bd7251dc863.tar.bz2
android_bootable_recovery-94720ced1a42fac53ebb4ca028719bd7251dc863.tar.lz
android_bootable_recovery-94720ced1a42fac53ebb4ca028719bd7251dc863.tar.xz
android_bootable_recovery-94720ced1a42fac53ebb4ca028719bd7251dc863.tar.zst
android_bootable_recovery-94720ced1a42fac53ebb4ca028719bd7251dc863.zip
Diffstat (limited to '')
-rw-r--r--adb_install.cpp2
-rw-r--r--install.cpp2
-rw-r--r--recovery.cpp6
-rw-r--r--roots.cpp2
-rw-r--r--updater/blockimg.cpp2
-rw-r--r--updater/install.cpp4
6 files changed, 9 insertions, 9 deletions
diff --git a/adb_install.cpp b/adb_install.cpp
index fab72f8a4..79b8df91b 100644
--- a/adb_install.cpp
+++ b/adb_install.cpp
@@ -78,7 +78,7 @@ int apply_from_adb(RecoveryUI* ui, bool* wipe_cache, const char* install_file) {
pid_t child;
if ((child = fork()) == 0) {
execl("/sbin/recovery", "recovery", "--adbd", NULL);
- _exit(-1);
+ _exit(EXIT_FAILURE);
}
// FUSE_SIDELOAD_HOST_PATHNAME will start to exist once the host
diff --git a/install.cpp b/install.cpp
index 248a1336e..f51bbf05c 100644
--- a/install.cpp
+++ b/install.cpp
@@ -387,7 +387,7 @@ static int try_update_binary(const char* path, ZipArchiveHandle zip, bool* wipe_
// the child process to hang. This deadlock results from an improperly
// copied mutex in the ui functions.
fprintf(stdout, "E:Can't run %s (%s)\n", chr_args[0], strerror(errno));
- _exit(-1);
+ _exit(EXIT_FAILURE);
}
close(pipefd[1]);
diff --git a/recovery.cpp b/recovery.cpp
index 25d3546e3..29d7ab889 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -243,7 +243,7 @@ static void redirect_stdio(const char* filename) {
if (log_fp == nullptr) {
PLOG(ERROR) << "fopen \"" << filename << "\" failed";
close(pipefd[0]);
- _exit(1);
+ _exit(EXIT_FAILURE);
}
FILE* pipe_fp = fdopen(pipefd[0], "r");
@@ -251,7 +251,7 @@ static void redirect_stdio(const char* filename) {
PLOG(ERROR) << "fdopen failed";
check_and_fclose(log_fp, filename);
close(pipefd[0]);
- _exit(1);
+ _exit(EXIT_FAILURE);
}
char* line = nullptr;
@@ -273,7 +273,7 @@ static void redirect_stdio(const char* filename) {
free(line);
check_and_fclose(log_fp, filename);
close(pipefd[0]);
- _exit(1);
+ _exit(EXIT_FAILURE);
} else {
// Redirect stdout/stderr to the logger process.
// Close the unused read end.
diff --git a/roots.cpp b/roots.cpp
index 376fcbd1b..4a0a4948a 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -163,7 +163,7 @@ static int exec_cmd(const char* path, char* const argv[]) {
pid_t child;
if ((child = vfork()) == 0) {
execv(path, argv);
- _exit(-1);
+ _exit(EXIT_FAILURE);
}
waitpid(child, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 6755d78cb..03ce4136e 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -120,7 +120,7 @@ static RangeSet parse_range(const std::string& range_text) {
err:
LOG(ERROR) << "failed to parse range '" << range_text << "'";
- exit(1);
+ exit(EXIT_FAILURE);
}
static bool range_overlaps(const RangeSet& r1, const RangeSet& r2) {
diff --git a/updater/install.cpp b/updater/install.cpp
index 7a8e92f6c..c7ecdb5c7 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -247,7 +247,7 @@ static int exec_cmd(const char* path, char* const argv[]) {
pid_t child;
if ((child = vfork()) == 0) {
execv(path, argv);
- _exit(-1);
+ _exit(EXIT_FAILURE);
}
int status;
@@ -1072,7 +1072,7 @@ Value* RunProgramFn(const char* name, State* state, int argc, Expr* argv[]) {
if (child == 0) {
execv(args2[0], args2);
PLOG(ERROR) << "run_program: execv failed";
- _exit(1);
+ _exit(EXIT_FAILURE);
}
int status;