| 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_MACOS) | 8 #if defined(TARGET_OS_MACOS) |
| 9 | 9 |
| 10 #include "bin/process.h" | 10 #include "bin/process.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "bin/thread.h" | 28 #include "bin/thread.h" |
| 29 | 29 |
| 30 #include "platform/signal_blocker.h" | 30 #include "platform/signal_blocker.h" |
| 31 #include "platform/utils.h" | 31 #include "platform/utils.h" |
| 32 | 32 |
| 33 namespace dart { | 33 namespace dart { |
| 34 namespace bin { | 34 namespace bin { |
| 35 | 35 |
| 36 int Process::global_exit_code_ = 0; | 36 int Process::global_exit_code_ = 0; |
| 37 Mutex* Process::global_exit_code_mutex_ = new Mutex(); | 37 Mutex* Process::global_exit_code_mutex_ = new Mutex(); |
| 38 Process::ExitHook Process::exit_hook_ = NULL; |
| 38 | 39 |
| 39 // ProcessInfo is used to map a process id to the file descriptor for | 40 // ProcessInfo is used to map a process id to the file descriptor for |
| 40 // the pipe used to communicate the exit code of the process to Dart. | 41 // the pipe used to communicate the exit code of the process to Dart. |
| 41 // ProcessInfo objects are kept in the static singly-linked | 42 // ProcessInfo objects are kept in the static singly-linked |
| 42 // ProcessInfoList. | 43 // ProcessInfoList. |
| 43 class ProcessInfo { | 44 class ProcessInfo { |
| 44 public: | 45 public: |
| 45 ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) { } | 46 ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) { } |
| 46 ~ProcessInfo() { | 47 ~ProcessInfo() { |
| 47 int closed = TEMP_FAILURE_RETRY(close(fd_)); | 48 int closed = TEMP_FAILURE_RETRY(close(fd_)); |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 1105 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
| 1105 } | 1106 } |
| 1106 } | 1107 } |
| 1107 | 1108 |
| 1108 } // namespace bin | 1109 } // namespace bin |
| 1109 } // namespace dart | 1110 } // namespace dart |
| 1110 | 1111 |
| 1111 #endif // defined(TARGET_OS_MACOS) | 1112 #endif // defined(TARGET_OS_MACOS) |
| 1112 | 1113 |
| 1113 #endif // !defined(DART_IO_DISABLED) | 1114 #endif // !defined(DART_IO_DISABLED) |
| OLD | NEW |