diff options
author | Tao Bao | 2017-02-03 15:09:23 -0600 |
---|---|---|
committer | Tao Bao | 2017-02-03 16:11:11 -0600 |
commit | 3da880156b4a56a6af5065ac10dfd6833cdcb1d4 (patch) | |
tree | 9f4ecbd604bd914dbc0725b3babc7781f5ec8957 /recovery.cpp | |
parent | 0f275ae56e2017db5ba2a712f84b710e8a9de99e (diff) | |
download | platform-bootable-recovery-3da880156b4a56a6af5065ac10dfd6833cdcb1d4.tar.gz platform-bootable-recovery-3da880156b4a56a6af5065ac10dfd6833cdcb1d4.tar.xz platform-bootable-recovery-3da880156b4a56a6af5065ac10dfd6833cdcb1d4.zip |
Replace _exit(-1) with _exit(EXIT_FAILURE).
-1 is not a valid exit status.
Also replace a few exit(1) with exit(EXIT_FAILURE).
Test: mmma bootable/recovery
Change-Id: I4596c8328b770bf95acccc06a4401bd5cabd4bfd
Diffstat (limited to 'recovery.cpp')
-rw-r--r-- | recovery.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/recovery.cpp b/recovery.cpp index 25d3546e..29d7ab88 100644 --- a/recovery.cpp +++ b/recovery.cpp | |||
@@ -243,7 +243,7 @@ static void redirect_stdio(const char* filename) { | |||
243 | if (log_fp == nullptr) { | 243 | if (log_fp == nullptr) { |
244 | PLOG(ERROR) << "fopen \"" << filename << "\" failed"; | 244 | PLOG(ERROR) << "fopen \"" << filename << "\" failed"; |
245 | close(pipefd[0]); | 245 | close(pipefd[0]); |
246 | _exit(1); | 246 | _exit(EXIT_FAILURE); |
247 | } | 247 | } |
248 | 248 | ||
249 | FILE* pipe_fp = fdopen(pipefd[0], "r"); | 249 | FILE* pipe_fp = fdopen(pipefd[0], "r"); |
@@ -251,7 +251,7 @@ static void redirect_stdio(const char* filename) { | |||
251 | PLOG(ERROR) << "fdopen failed"; | 251 | PLOG(ERROR) << "fdopen failed"; |
252 | check_and_fclose(log_fp, filename); | 252 | check_and_fclose(log_fp, filename); |
253 | close(pipefd[0]); | 253 | close(pipefd[0]); |
254 | _exit(1); | 254 | _exit(EXIT_FAILURE); |
255 | } | 255 | } |
256 | 256 | ||
257 | char* line = nullptr; | 257 | char* line = nullptr; |
@@ -273,7 +273,7 @@ static void redirect_stdio(const char* filename) { | |||
273 | free(line); | 273 | free(line); |
274 | check_and_fclose(log_fp, filename); | 274 | check_and_fclose(log_fp, filename); |
275 | close(pipefd[0]); | 275 | close(pipefd[0]); |
276 | _exit(1); | 276 | _exit(EXIT_FAILURE); |
277 | } else { | 277 | } else { |
278 | // Redirect stdout/stderr to the logger process. | 278 | // Redirect stdout/stderr to the logger process. |
279 | // Close the unused read end. | 279 | // Close the unused read end. |