Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Side by Side Diff: runtime/bin/process_macos.cc

Issue 1174343006: Landing https://codereview.chromium.org/1171223003/ for Chinmay. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/platform_macos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <crt_externs.h> // NOLINT 11 #include <crt_externs.h> // NOLINT
12 #endif
11 #include <errno.h> // NOLINT 13 #include <errno.h> // NOLINT
12 #include <fcntl.h> // NOLINT 14 #include <fcntl.h> // NOLINT
13 #include <poll.h> // NOLINT 15 #include <poll.h> // NOLINT
14 #include <signal.h> // NOLINT 16 #include <signal.h> // NOLINT
15 #include <stdio.h> // NOLINT 17 #include <stdio.h> // NOLINT
16 #include <stdlib.h> // NOLINT 18 #include <stdlib.h> // NOLINT
17 #include <string.h> // NOLINT 19 #include <string.h> // NOLINT
18 #include <unistd.h> // NOLINT 20 #include <unistd.h> // NOLINT
19 21
20 #include "bin/fdutils.h" 22 #include "bin/fdutils.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 446
445 if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) { 447 if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) {
446 ReportChildError(); 448 ReportChildError();
447 } 449 }
448 450
449 if (working_directory_ != NULL && 451 if (working_directory_ != NULL &&
450 TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) { 452 TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1) {
451 ReportChildError(); 453 ReportChildError();
452 } 454 }
453 455
456 #if !defined(TARGET_OS_IOS)
454 if (program_environment_ != NULL) { 457 if (program_environment_ != NULL) {
455 // On MacOS you have to do a bit of magic to get to the 458 // On MacOS you have to do a bit of magic to get to the
456 // environment strings. 459 // environment strings.
457 char*** environ = _NSGetEnviron(); 460 char*** environ = _NSGetEnviron();
458 *environ = program_environment_; 461 *environ = program_environment_;
459 } 462 }
463 #endif
460 464
461 VOID_TEMP_FAILURE_RETRY( 465 VOID_TEMP_FAILURE_RETRY(
462 execvp(path_, const_cast<char* const*>(program_arguments_))); 466 execvp(path_, const_cast<char* const*>(program_arguments_)));
463 467
464 ReportChildError(); 468 ReportChildError();
465 } 469 }
466 470
467 471
468 void ExecDetachedProcess() { 472 void ExecDetachedProcess() {
469 if (mode_ == kDetached) { 473 if (mode_ == kDetached) {
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 bzero(&act, sizeof(act)); 1046 bzero(&act, sizeof(act));
1043 act.sa_handler = SIG_DFL; 1047 act.sa_handler = SIG_DFL;
1044 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); 1048 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL));
1045 } 1049 }
1046 } 1050 }
1047 1051
1048 } // namespace bin 1052 } // namespace bin
1049 } // namespace dart 1053 } // namespace dart
1050 1054
1051 #endif // defined(TARGET_OS_MACOS) 1055 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/bin/platform_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698