OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 // Second generation sel_universal implemented in C++ | 7 // Second generation sel_universal implemented in C++ |
8 | 8 |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 int fd = open(PORTABLE_DEV_NULL, O_RDWR); | 186 int fd = open(PORTABLE_DEV_NULL, O_RDWR); |
187 sel_ldr_argv.push_back("-w"); | 187 sel_ldr_argv.push_back("-w"); |
188 ss_stdout << "1:" << fd; | 188 ss_stdout << "1:" << fd; |
189 sel_ldr_argv.push_back(ss_stdout.str()); | 189 sel_ldr_argv.push_back(ss_stdout.str()); |
190 sel_ldr_argv.push_back("-w"); | 190 sel_ldr_argv.push_back("-w"); |
191 ss_stderr << "2:" << fd; | 191 ss_stderr << "2:" << fd; |
192 sel_ldr_argv.push_back(ss_stderr.str()); | 192 sel_ldr_argv.push_back(ss_stderr.str()); |
193 } | 193 } |
194 // Start sel_ldr with the given application and arguments. | 194 // Start sel_ldr with the given application and arguments. |
195 nacl::SelLdrLauncher launcher; | 195 nacl::SelLdrLauncherStandalone launcher; |
196 nacl::DescWrapperFactory factory; // DescWrapper "namespace" | 196 nacl::DescWrapperFactory factory; // DescWrapper "namespace" |
197 | 197 |
198 if (!launcher.StartViaCommandLine(command_prefix, sel_ldr_argv, app_argv)) { | 198 if (!launcher.StartViaCommandLine(command_prefix, sel_ldr_argv, app_argv)) { |
199 NaClLog(LOG_FATAL, "sel_universal: Failed to launch sel_ldr\n"); | 199 NaClLog(LOG_FATAL, "sel_universal: Failed to launch sel_ldr\n"); |
200 } | 200 } |
201 | 201 |
202 DescWrapper *host_file = factory.OpenHostFile(app_name.c_str(), O_RDONLY, 0); | 202 DescWrapper *host_file = factory.OpenHostFile(app_name.c_str(), O_RDONLY, 0); |
203 if (NULL == host_file) { | 203 if (NULL == host_file) { |
204 NaClLog(LOG_ERROR, "Could not open %s\n", app_name.c_str()); | 204 NaClLog(LOG_ERROR, "Could not open %s\n", app_name.c_str()); |
205 exit(1); | 205 exit(1); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 NaClSrpcModuleInit(); | 290 NaClSrpcModuleInit(); |
291 NaClNrdAllModulesInit(); | 291 NaClNrdAllModulesInit(); |
292 | 292 |
293 int exit_status = raii_main(argc, argv); | 293 int exit_status = raii_main(argc, argv); |
294 | 294 |
295 NaClSrpcModuleFini(); | 295 NaClSrpcModuleFini(); |
296 NaClNrdAllModulesFini(); | 296 NaClNrdAllModulesFini(); |
297 | 297 |
298 return exit_status; | 298 return exit_status; |
299 } | 299 } |
OLD | NEW |