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_LINUX) | 8 #if defined(TARGET_OS_LINUX) |
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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 sigaction(signal, &act, NULL); | 1034 sigaction(signal, &act, NULL); |
1034 } | 1035 } |
1035 } | 1036 } |
1036 | 1037 |
1037 } // namespace bin | 1038 } // namespace bin |
1038 } // namespace dart | 1039 } // namespace dart |
1039 | 1040 |
1040 #endif // defined(TARGET_OS_LINUX) | 1041 #endif // defined(TARGET_OS_LINUX) |
1041 | 1042 |
1042 #endif // !defined(DART_IO_DISABLED) | 1043 #endif // !defined(DART_IO_DISABLED) |
OLD | NEW |