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

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

Issue 2621783003: Fuchsia: Pass a job to launchpad_create() (Closed)
Patch Set: Format Created 3 years, 11 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 | « no previous file | runtime/bin/run_vm_tests_fuchsia.cc » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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_FUCHSIA) 8 #if defined(TARGET_OS_FUCHSIA)
9 9
10 #include "bin/process.h" 10 #include "bin/process.h"
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 } 728 }
729 729
730 mx_status_t SetupLaunchpad() { 730 mx_status_t SetupLaunchpad() {
731 mx_handle_t binary_vmo = launchpad_vmo_from_file(path_); 731 mx_handle_t binary_vmo = launchpad_vmo_from_file(path_);
732 CHECK_FOR_ERROR(binary_vmo, "launchpad_vmo_from_file"); 732 CHECK_FOR_ERROR(binary_vmo, "launchpad_vmo_from_file");
733 binary_vmo_ = binary_vmo; 733 binary_vmo_ = binary_vmo;
734 734
735 launchpad_t* lp; 735 launchpad_t* lp;
736 mx_status_t status; 736 mx_status_t status;
737 737
738 status = launchpad_create(0, program_arguments_[0], &lp); 738 mx_handle_t job = MX_HANDLE_INVALID;
739 status = mx_handle_duplicate(launchpad_get_mxio_job(), MX_RIGHT_SAME_RIGHTS,
740 &job);
741 CHECK_FOR_ERROR(status, "mx_handle_duplicate");
742
743 status = launchpad_create(job, program_arguments_[0], &lp);
739 CHECK_FOR_ERROR(status, "launchpad_create"); 744 CHECK_FOR_ERROR(status, "launchpad_create");
740 launchpad_ = lp; 745 launchpad_ = lp;
741 746
742 status = 747 status =
743 launchpad_arguments(lp, program_arguments_count_, program_arguments_); 748 launchpad_arguments(lp, program_arguments_count_, program_arguments_);
744 CHECK_FOR_ERROR(status, "launchpad_arguments"); 749 CHECK_FOR_ERROR(status, "launchpad_arguments");
745 750
746 status = launchpad_environ(lp, program_environment_); 751 status = launchpad_environ(lp, program_environment_);
747 CHECK_FOR_ERROR(status, "launchpad_environ"); 752 CHECK_FOR_ERROR(status, "launchpad_environ");
748 753
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 void Process::ClearSignalHandler(intptr_t signal) { 844 void Process::ClearSignalHandler(intptr_t signal) {
840 UNIMPLEMENTED(); 845 UNIMPLEMENTED();
841 } 846 }
842 847
843 } // namespace bin 848 } // namespace bin
844 } // namespace dart 849 } // namespace dart
845 850
846 #endif // defined(TARGET_OS_FUCHSIA) 851 #endif // defined(TARGET_OS_FUCHSIA)
847 852
848 #endif // !defined(DART_IO_DISABLED) 853 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/run_vm_tests_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698