diff options
author | Selim Gurun <sgurun@google.com> | 2012-06-05 18:18:30 -0700 |
---|---|---|
committer | Selim Gurun <sgurun@google.com> | 2012-06-06 10:10:55 -0700 |
commit | 86e0fcf830dcbada802ea2de22904e912dda5384 (patch) | |
tree | 70cbd98be2fe6481feecf9cee18db8845aa9f32b /base/process_util_posix.cc | |
parent | 4f8351323b84a7b8c3275e6df8a99a4738fabf45 (diff) | |
download | external_chromium-86e0fcf830dcbada802ea2de22904e912dda5384.zip external_chromium-86e0fcf830dcbada802ea2de22904e912dda5384.tar.gz external_chromium-86e0fcf830dcbada802ea2de22904e912dda5384.tar.bz2 |
DO NOT MERGE Convert exit calls to abort for Android
Bug: 6603427
Cherry picking from master to jb-dev. Sha:
edec5f424996d4a532ba6fdb2203c06a02887606
This is to track some silent failures happening in mediaserver.
Change-Id: I9345cee5e0137b723fd5a2b7c787c235af4462b8
Diffstat (limited to 'base/process_util_posix.cc')
-rw-r--r-- | base/process_util_posix.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index 47f04a9..3270079 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -155,7 +155,11 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, ucontext_t* context) { write(STDERR_FILENO, buf, std::min(len, sizeof(buf) - 1)); #endif // ARCH_CPU_32_BITS #endif // defined(OS_MACOSX) +#ifdef ANDROID + abort(); +#else _exit(1); +#endif } void ResetChildSignalHandlersToDefaults() { @@ -529,14 +533,22 @@ bool LaunchAppImpl( int null_fd = HANDLE_EINTR(open("/dev/null", O_RDONLY)); if (null_fd < 0) { RAW_LOG(ERROR, "Failed to open /dev/null"); +#ifdef ANDROID + abort(); +#else _exit(127); +#endif } file_util::ScopedFD null_fd_closer(&null_fd); int new_fd = HANDLE_EINTR(dup2(null_fd, STDIN_FILENO)); if (new_fd != STDIN_FILENO) { RAW_LOG(ERROR, "Failed to dup /dev/null for stdin"); +#ifdef ANDROID + abort(); +#else _exit(127); +#endif } if (start_new_process_group) { @@ -544,7 +556,11 @@ bool LaunchAppImpl( // starts off a new process group with pgid equal to its process ID. if (setpgid(0, 0) < 0) { RAW_LOG(ERROR, "setpgid failed"); +#ifdef ANDROID + abort(); +#else _exit(127); +#endif } } #if defined(OS_MACOSX) @@ -575,7 +591,11 @@ bool LaunchAppImpl( // fd_shuffle1 is mutated by this call because it cannot malloc. if (!ShuffleFileDescriptors(&fd_shuffle1)) +#ifdef ANDROID + abort(); +#else _exit(127); +#endif CloseSuperfluousFds(fd_shuffle2); @@ -585,7 +605,11 @@ bool LaunchAppImpl( execvp(argv_cstr[0], argv_cstr.get()); RAW_LOG(ERROR, "LaunchApp: failed to execvp:"); RAW_LOG(ERROR, argv_cstr[0]); +#ifdef ANDROID + abort(); +#else _exit(127); +#endif } else { // Parent process if (wait) { @@ -891,7 +915,11 @@ static bool GetAppOutputInternal(const CommandLine& cl, char* const envp[], // in the child. int dev_null = open("/dev/null", O_WRONLY); if (dev_null < 0) +#ifdef ANDROID + abort(); +#else _exit(127); +#endif fd_shuffle1.push_back(InjectionArc(pipe_fd[1], STDOUT_FILENO, true)); fd_shuffle1.push_back(InjectionArc(dev_null, STDERR_FILENO, true)); @@ -903,7 +931,11 @@ static bool GetAppOutputInternal(const CommandLine& cl, char* const envp[], std::back_inserter(fd_shuffle2)); if (!ShuffleFileDescriptors(&fd_shuffle1)) +#ifdef ANDROID + abort(); +#else _exit(127); +#endif CloseSuperfluousFds(fd_shuffle2); @@ -914,7 +946,11 @@ static bool GetAppOutputInternal(const CommandLine& cl, char* const envp[], execvp(argv_cstr[0], argv_cstr.get()); else execve(argv_cstr[0], argv_cstr.get(), envp); +#ifdef ANDROID + abort(); +#else _exit(127); +#endif } default: // parent { |