| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 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 /* | 7 /* |
| 8 * NaCl Simple/secure ELF loader (NaCl SEL). | 8 * NaCl Simple/secure ELF loader (NaCl SEL). |
| 9 */ | 9 */ |
| 10 #include "native_client/src/include/portability.h" | 10 #include "native_client/src/include/portability.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 NaClAppInitialDescriptorHookup(nap); | 603 NaClAppInitialDescriptorHookup(nap); |
| 604 | 604 |
| 605 /* | 605 /* |
| 606 * Execute additional I/O redirections. NB: since the NaClApp | 606 * Execute additional I/O redirections. NB: since the NaClApp |
| 607 * takes ownership of host / IMC socket descriptors, all but | 607 * takes ownership of host / IMC socket descriptors, all but |
| 608 * the first run will not get access if the NaClApp closes | 608 * the first run will not get access if the NaClApp closes |
| 609 * them. Currently a normal NaClApp process exit does not | 609 * them. Currently a normal NaClApp process exit does not |
| 610 * close descriptors, since the underlying host OS will do so | 610 * close descriptors, since the underlying host OS will do so |
| 611 * as part of service runtime exit. | 611 * as part of service runtime exit. |
| 612 */ | 612 */ |
| 613 NaClLog(4, "Processing I/O redirection/inheritance from environment\n"); | 613 NaClLog(4, "Processing I/O redirection/inheritance from command line\n"); |
| 614 for (entry = redir_queue; NULL != entry; entry = entry->next) { | 614 for (entry = redir_queue; NULL != entry; entry = entry->next) { |
| 615 switch (entry->tag) { | 615 switch (entry->tag) { |
| 616 case HOST_DESC: | 616 case HOST_DESC: |
| 617 NaClAddHostDescriptor(nap, entry->u.host.d, | 617 NaClAddHostDescriptor(nap, entry->u.host.d, |
| 618 entry->u.host.mode, entry->nacl_desc); | 618 entry->u.host.mode, entry->nacl_desc); |
| 619 break; | 619 break; |
| 620 case IMC_DESC: | 620 case IMC_DESC: |
| 621 NaClAddImcHandle(nap, entry->u.handle, entry->nacl_desc); | 621 NaClAddImcHandle(nap, entry->u.handle, entry->nacl_desc); |
| 622 break; | 622 break; |
| 623 } | 623 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 fflush(stdout); | 884 fflush(stdout); |
| 885 | 885 |
| 886 if (handle_signals) NaClSignalHandlerFini(); | 886 if (handle_signals) NaClSignalHandlerFini(); |
| 887 NaClAllModulesFini(); | 887 NaClAllModulesFini(); |
| 888 | 888 |
| 889 NaClExit(ret_code); | 889 NaClExit(ret_code); |
| 890 | 890 |
| 891 /* Unreachable, but having the return prevents a compiler error. */ | 891 /* Unreachable, but having the return prevents a compiler error. */ |
| 892 return ret_code; | 892 return ret_code; |
| 893 } | 893 } |
| OLD | NEW |