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

Side by Side Diff: runtime/bin/run_vm_tests_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 | « runtime/bin/process_fuchsia.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) 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 #include <fcntl.h> 5 #include <fcntl.h>
6 #include <launchpad/launchpad.h> 6 #include <launchpad/launchpad.h>
7 #include <launchpad/vmo.h> 7 #include <launchpad/vmo.h>
8 #include <magenta/status.h> 8 #include <magenta/status.h>
9 #include <magenta/syscalls.h> 9 #include <magenta/syscalls.h>
10 #include <magenta/syscalls/object.h> 10 #include <magenta/syscalls/object.h>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 mx_handle_t binary_vmo, 126 mx_handle_t binary_vmo,
127 int argc, 127 int argc,
128 const char* const* argv, 128 const char* const* argv,
129 int* stdout_out, 129 int* stdout_out,
130 int* stderr_out) { 130 int* stderr_out) {
131 if ((lp_out == NULL) || (stdout_out == NULL) || (stderr_out == NULL)) { 131 if ((lp_out == NULL) || (stdout_out == NULL) || (stderr_out == NULL)) {
132 return ERR_INVALID_ARGS; 132 return ERR_INVALID_ARGS;
133 } 133 }
134 launchpad_t* lp; 134 launchpad_t* lp;
135 mx_status_t status; 135 mx_status_t status;
136 status = launchpad_create(0, argv[0], &lp); 136 mx_handle_t job = MX_HANDLE_INVALID;
137 status =
138 mx_handle_duplicate(launchpad_get_mxio_job(), MX_RIGHT_SAME_RIGHTS, &job);
139 RETURN_IF_ERROR(status);
140 status = launchpad_create(job, argv[0], &lp);
137 RETURN_IF_ERROR(status); 141 RETURN_IF_ERROR(status);
138 status = launchpad_arguments(lp, argc, argv); 142 status = launchpad_arguments(lp, argc, argv);
139 RETURN_IF_ERROR(status); 143 RETURN_IF_ERROR(status);
140 status = launchpad_clone_mxio_root(lp); 144 status = launchpad_clone_mxio_root(lp);
141 RETURN_IF_ERROR(status); 145 RETURN_IF_ERROR(status);
142 status = launchpad_add_pipe(lp, stdout_out, 1); 146 status = launchpad_add_pipe(lp, stdout_out, 1);
143 RETURN_IF_ERROR(status); 147 RETURN_IF_ERROR(status);
144 status = launchpad_add_pipe(lp, stderr_out, 2); 148 status = launchpad_add_pipe(lp, stderr_out, 2);
145 RETURN_IF_ERROR(status); 149 RETURN_IF_ERROR(status);
146 status = launchpad_add_vdso_vmo(lp); 150 status = launchpad_add_vdso_vmo(lp);
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 RETURN_IF_ERROR(status); 428 RETURN_IF_ERROR(status);
425 429
426 // Complain if we didn't try to run all of the tests. 430 // Complain if we didn't try to run all of the tests.
427 if (test_list_index != lines_count) { 431 if (test_list_index != lines_count) {
428 fprintf(stderr, "Failed to attempt all the tests!\n"); 432 fprintf(stderr, "Failed to attempt all the tests!\n");
429 fflush(0); 433 fflush(0);
430 return -1; 434 return -1;
431 } 435 }
432 return 0; 436 return 0;
433 } 437 }
OLDNEW
« no previous file with comments | « runtime/bin/process_fuchsia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698