| 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 #include "native_client/src/include/portability.h" | 7 #include "native_client/src/include/portability.h" |
| 8 #include "native_client/src/include/portability_io.h" | 8 #include "native_client/src/include/portability_io.h" |
| 9 | 9 |
| 10 #if NACL_OSX | 10 #if NACL_OSX |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 * We enable the signal handler to verify properties of the platform such | 98 * We enable the signal handler to verify properties of the platform such |
| 99 * as the ability to trap a page on execute. | 99 * as the ability to trap a page on execute. |
| 100 */ | 100 */ |
| 101 NaClSignalHandlerInit(); | 101 NaClSignalHandlerInit(); |
| 102 errcode = NaClRunSelQualificationTests(); | 102 errcode = NaClRunSelQualificationTests(); |
| 103 if (LOAD_OK != errcode) { | 103 if (LOAD_OK != errcode) { |
| 104 nap->module_load_status = errcode; | 104 nap->module_load_status = errcode; |
| 105 fprintf(stderr, "Error while loading in SelMain: %s\n", | 105 fprintf(stderr, "Error while loading in SelMain: %s\n", |
| 106 NaClErrorString(errcode)); | 106 NaClErrorString(errcode)); |
| 107 } | 107 } |
| 108 /* Remove the handler that was used for platform qualification tests. */ |
| 109 NaClSignalHandlerFini(); |
| 108 | 110 |
| 109 /* | 111 /* |
| 110 * Remove the handler and let error pass to Chrome's handlers. | 112 * Check that Chrome did not register any signal handlers, because |
| 113 * these are not always safe. |
| 111 */ | 114 */ |
| 112 NaClSignalHandlerFini(); | 115 NaClSignalAssertNoHandlers(); |
| 113 | |
| 114 | 116 |
| 115 /* Give debuggers a well known point at which xlate_base is known. */ | 117 /* Give debuggers a well known point at which xlate_base is known. */ |
| 116 NaClGdbHook(&state); | 118 NaClGdbHook(&state); |
| 117 | 119 |
| 118 /* | 120 /* |
| 119 * If export_addr_to is set to a non-negative integer, we create a | 121 * If export_addr_to is set to a non-negative integer, we create a |
| 120 * bound socket and socket address pair and bind the former to | 122 * bound socket and socket address pair and bind the former to |
| 121 * descriptor 3 and the latter to descriptor 4. The socket address | 123 * descriptor 3 and the latter to descriptor 4. The socket address |
| 122 * is written out to the export_addr_to descriptor. | 124 * is written out to the export_addr_to descriptor. |
| 123 * | 125 * |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 */ | 194 */ |
| 193 return ret_code; | 195 return ret_code; |
| 194 | 196 |
| 195 done: | 197 done: |
| 196 fflush(stdout); | 198 fflush(stdout); |
| 197 | 199 |
| 198 NaClAllModulesFini(); | 200 NaClAllModulesFini(); |
| 199 | 201 |
| 200 return ret_code; | 202 return ret_code; |
| 201 } | 203 } |
| OLD | NEW |