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(HOST_OS_MACOS) |
9 | 9 |
10 #include "bin/process.h" | 10 #include "bin/process.h" |
11 | 11 |
12 #if !TARGET_OS_IOS | 12 #if !HOST_OS_IOS |
13 #include <crt_externs.h> // NOLINT | 13 #include <crt_externs.h> // NOLINT |
14 #endif | 14 #endif |
15 #include <errno.h> // NOLINT | 15 #include <errno.h> // NOLINT |
16 #include <fcntl.h> // NOLINT | 16 #include <fcntl.h> // NOLINT |
17 #include <poll.h> // NOLINT | 17 #include <poll.h> // NOLINT |
18 #include <signal.h> // NOLINT | 18 #include <signal.h> // NOLINT |
19 #include <stdio.h> // NOLINT | 19 #include <stdio.h> // NOLINT |
20 #include <stdlib.h> // NOLINT | 20 #include <stdlib.h> // NOLINT |
21 #include <string.h> // NOLINT | 21 #include <string.h> // NOLINT |
22 #include <unistd.h> // NOLINT | 22 #include <unistd.h> // NOLINT |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 458 |
459 if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) { | 459 if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) { |
460 ReportChildError(); | 460 ReportChildError(); |
461 } | 461 } |
462 | 462 |
463 if (working_directory_ != NULL && | 463 if (working_directory_ != NULL && |
464 TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) { | 464 TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) { |
465 ReportChildError(); | 465 ReportChildError(); |
466 } | 466 } |
467 | 467 |
468 #if !TARGET_OS_IOS | 468 #if !HOST_OS_IOS |
469 if (program_environment_ != NULL) { | 469 if (program_environment_ != NULL) { |
470 // On MacOS you have to do a bit of magic to get to the | 470 // On MacOS you have to do a bit of magic to get to the |
471 // environment strings. | 471 // environment strings. |
472 char*** environ = _NSGetEnviron(); | 472 char*** environ = _NSGetEnviron(); |
473 *environ = program_environment_; | 473 *environ = program_environment_; |
474 } | 474 } |
475 #endif | 475 #endif |
476 | 476 |
477 VOID_TEMP_FAILURE_RETRY( | 477 VOID_TEMP_FAILURE_RETRY( |
478 execvp(path_, const_cast<char* const*>(program_arguments_))); | 478 execvp(path_, const_cast<char* const*>(program_arguments_))); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 struct sigaction act; | 1083 struct sigaction act; |
1084 bzero(&act, sizeof(act)); | 1084 bzero(&act, sizeof(act)); |
1085 act.sa_handler = SIG_DFL; | 1085 act.sa_handler = SIG_DFL; |
1086 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 1086 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
1087 } | 1087 } |
1088 } | 1088 } |
1089 | 1089 |
1090 } // namespace bin | 1090 } // namespace bin |
1091 } // namespace dart | 1091 } // namespace dart |
1092 | 1092 |
1093 #endif // defined(TARGET_OS_MACOS) | 1093 #endif // defined(HOST_OS_MACOS) |
1094 | 1094 |
1095 #endif // !defined(DART_IO_DISABLED) | 1095 #endif // !defined(DART_IO_DISABLED) |
OLD | NEW |