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 /* | 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/build_config.h" | 10 #include "native_client/src/include/build_config.h" |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 | 737 |
738 /* | 738 /* |
739 * Make sure all the file buffers are flushed before entering | 739 * Make sure all the file buffers are flushed before entering |
740 * the application code. | 740 * the application code. |
741 */ | 741 */ |
742 fflush((FILE *) NULL); | 742 fflush((FILE *) NULL); |
743 | 743 |
744 NaClAppStartModule(nap, NULL, NULL); | 744 NaClAppStartModule(nap, NULL, NULL); |
745 | 745 |
746 /* | 746 /* |
747 * For restricted file access, change directory to the root | 747 * For restricted file access, change directory to the root of the restricted |
748 * of the restricted directory. | 748 * directory. This is required for safety, because we allow relative |
| 749 * pathnames. |
749 */ | 750 */ |
750 if (NaClRootDir != NULL && NaClHostDescChdir(NaClRootDir)) { | 751 if (NaClRootDir != NULL && NaClHostDescChdir(NaClRootDir)) { |
751 NaClLog(LOG_FATAL, "Could not change directory to root dir\n"); | 752 NaClLog(LOG_FATAL, "Could not change directory to root dir\n"); |
752 } | 753 } |
753 | 754 |
754 /* | 755 /* |
755 * error reporting done; can quit now if there was an error earlier. | 756 * error reporting done; can quit now if there was an error earlier. |
756 */ | 757 */ |
757 if (LOAD_OK != errcode) { | 758 if (LOAD_OK != errcode) { |
758 NaClLog(4, | 759 NaClLog(4, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 #if NACL_LINUX | 817 #if NACL_LINUX |
817 NaClSignalHandlerFini(); | 818 NaClSignalHandlerFini(); |
818 #endif | 819 #endif |
819 NaClAllModulesFini(); | 820 NaClAllModulesFini(); |
820 | 821 |
821 NaClExit(ret_code); | 822 NaClExit(ret_code); |
822 | 823 |
823 /* Unreachable, but having the return prevents a compiler error. */ | 824 /* Unreachable, but having the return prevents a compiler error. */ |
824 return ret_code; | 825 return ret_code; |
825 } | 826 } |
OLD | NEW |