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(HOST_OS_ANDROID) | 8 #if defined(HOST_OS_ANDROID) |
9 | 9 |
10 #include "bin/process.h" | 10 #include "bin/process.h" |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 (TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1)) { | 512 (TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1)) { |
513 ReportChildError(); | 513 ReportChildError(); |
514 } | 514 } |
515 | 515 |
516 // Report the final PID and do the exec. | 516 // Report the final PID and do the exec. |
517 ReportPid(getpid()); // getpid cannot fail. | 517 ReportPid(getpid()); // getpid cannot fail. |
518 VOID_TEMP_FAILURE_RETRY( | 518 VOID_TEMP_FAILURE_RETRY( |
519 execvp(path_, const_cast<char* const*>(program_arguments_))); | 519 execvp(path_, const_cast<char* const*>(program_arguments_))); |
520 ReportChildError(); | 520 ReportChildError(); |
521 } else { | 521 } else { |
522 // Exit the intermeiate process. | 522 // Exit the intermediate process. |
523 exit(0); | 523 exit(0); |
524 } | 524 } |
525 } | 525 } |
526 } else { | 526 } else { |
527 // Exit the intermeiate process. | 527 // Exit the intermediate process. |
528 exit(0); | 528 exit(0); |
529 } | 529 } |
530 } | 530 } |
531 | 531 |
532 | 532 |
533 int RegisterProcess(pid_t pid) { | 533 int RegisterProcess(pid_t pid) { |
534 int result; | 534 int result; |
535 int event_fds[2]; | 535 int event_fds[2]; |
536 result = TEMP_FAILURE_RETRY(pipe2(event_fds, O_CLOEXEC)); | 536 result = TEMP_FAILURE_RETRY(pipe2(event_fds, O_CLOEXEC)); |
537 if (result < 0) { | 537 if (result < 0) { |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 1032 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
1033 } | 1033 } |
1034 } | 1034 } |
1035 | 1035 |
1036 } // namespace bin | 1036 } // namespace bin |
1037 } // namespace dart | 1037 } // namespace dart |
1038 | 1038 |
1039 #endif // defined(HOST_OS_ANDROID) | 1039 #endif // defined(HOST_OS_ANDROID) |
1040 | 1040 |
1041 #endif // !defined(DART_IO_DISABLED) | 1041 #endif // !defined(DART_IO_DISABLED) |
OLD | NEW |