| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #if !defined(DART_IO_DISABLED) | 5 #if !defined(DART_IO_DISABLED) |
| 6 | 6 |
| 7 #include "platform/globals.h" | 7 #include "platform/globals.h" |
| 8 #if defined(TARGET_OS_ANDROID) | 8 #if defined(TARGET_OS_ANDROID) |
| 9 | 9 |
| 10 #include "bin/process.h" | 10 #include "bin/process.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "platform/signal_blocker.h" | 27 #include "platform/signal_blocker.h" |
| 28 #include "platform/utils.h" | 28 #include "platform/utils.h" |
| 29 | 29 |
| 30 extern char **environ; | 30 extern char **environ; |
| 31 | 31 |
| 32 namespace dart { | 32 namespace dart { |
| 33 namespace bin { | 33 namespace bin { |
| 34 | 34 |
| 35 int Process::global_exit_code_ = 0; | 35 int Process::global_exit_code_ = 0; |
| 36 Mutex* Process::global_exit_code_mutex_ = new Mutex(); | 36 Mutex* Process::global_exit_code_mutex_ = new Mutex(); |
| 37 Process::ExitHook Process::exit_hook_ = NULL; |
| 37 | 38 |
| 38 // ProcessInfo is used to map a process id to the file descriptor for | 39 // ProcessInfo is used to map a process id to the file descriptor for |
| 39 // the pipe used to communicate the exit code of the process to Dart. | 40 // the pipe used to communicate the exit code of the process to Dart. |
| 40 // ProcessInfo objects are kept in the static singly-linked | 41 // ProcessInfo objects are kept in the static singly-linked |
| 41 // ProcessInfoList. | 42 // ProcessInfoList. |
| 42 class ProcessInfo { | 43 class ProcessInfo { |
| 43 public: | 44 public: |
| 44 ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) { } | 45 ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) { } |
| 45 ~ProcessInfo() { | 46 ~ProcessInfo() { |
| 46 int closed = TEMP_FAILURE_RETRY(close(fd_)); | 47 int closed = TEMP_FAILURE_RETRY(close(fd_)); |
| (...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 1038 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
| 1038 } | 1039 } |
| 1039 } | 1040 } |
| 1040 | 1041 |
| 1041 } // namespace bin | 1042 } // namespace bin |
| 1042 } // namespace dart | 1043 } // namespace dart |
| 1043 | 1044 |
| 1044 #endif // defined(TARGET_OS_ANDROID) | 1045 #endif // defined(TARGET_OS_ANDROID) |
| 1045 | 1046 |
| 1046 #endif // !defined(DART_IO_DISABLED) | 1047 #endif // !defined(DART_IO_DISABLED) |
| OLD | NEW |