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 #include "platform/globals.h" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
7 | 7 |
8 #include "bin/process.h" | 8 #include "bin/process.h" |
9 | 9 |
10 #if !defined(TARGET_OS_IOS) | 10 #if !TARGET_OS_IOS |
11 #include <crt_externs.h> // NOLINT | 11 #include <crt_externs.h> // NOLINT |
12 #endif | 12 #endif |
13 #include <errno.h> // NOLINT | 13 #include <errno.h> // NOLINT |
14 #include <fcntl.h> // NOLINT | 14 #include <fcntl.h> // NOLINT |
15 #include <poll.h> // NOLINT | 15 #include <poll.h> // NOLINT |
16 #include <signal.h> // NOLINT | 16 #include <signal.h> // NOLINT |
17 #include <stdio.h> // NOLINT | 17 #include <stdio.h> // NOLINT |
18 #include <stdlib.h> // NOLINT | 18 #include <stdlib.h> // NOLINT |
19 #include <string.h> // NOLINT | 19 #include <string.h> // NOLINT |
20 #include <unistd.h> // NOLINT | 20 #include <unistd.h> // NOLINT |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 444 |
445 if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) { | 445 if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) { |
446 ReportChildError(); | 446 ReportChildError(); |
447 } | 447 } |
448 | 448 |
449 if (working_directory_ != NULL && | 449 if (working_directory_ != NULL && |
450 TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) { | 450 TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) { |
451 ReportChildError(); | 451 ReportChildError(); |
452 } | 452 } |
453 | 453 |
454 #if !defined(TARGET_OS_IOS) | 454 #if !TARGET_OS_IOS |
455 if (program_environment_ != NULL) { | 455 if (program_environment_ != NULL) { |
456 // On MacOS you have to do a bit of magic to get to the | 456 // On MacOS you have to do a bit of magic to get to the |
457 // environment strings. | 457 // environment strings. |
458 char*** environ = _NSGetEnviron(); | 458 char*** environ = _NSGetEnviron(); |
459 *environ = program_environment_; | 459 *environ = program_environment_; |
460 } | 460 } |
461 #endif | 461 #endif |
462 | 462 |
463 VOID_TEMP_FAILURE_RETRY( | 463 VOID_TEMP_FAILURE_RETRY( |
464 execvp(path_, const_cast<char* const*>(program_arguments_))); | 464 execvp(path_, const_cast<char* const*>(program_arguments_))); |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 bzero(&act, sizeof(act)); | 1062 bzero(&act, sizeof(act)); |
1063 act.sa_handler = SIG_DFL; | 1063 act.sa_handler = SIG_DFL; |
1064 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 1064 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
1065 } | 1065 } |
1066 } | 1066 } |
1067 | 1067 |
1068 } // namespace bin | 1068 } // namespace bin |
1069 } // namespace dart | 1069 } // namespace dart |
1070 | 1070 |
1071 #endif // defined(TARGET_OS_MACOS) | 1071 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |