| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008, Google Inc. | 2 * Copyright 2008, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (!DynArrayCtor(&nap->threads, 2)) { | 69 if (!DynArrayCtor(&nap->threads, 2)) { |
| 70 goto cleanup_none; | 70 goto cleanup_none; |
| 71 } | 71 } |
| 72 if (!DynArrayCtor(&nap->desc_tbl, 2)) { | 72 if (!DynArrayCtor(&nap->desc_tbl, 2)) { |
| 73 goto cleanup_threads; | 73 goto cleanup_threads; |
| 74 } | 74 } |
| 75 if (!NaClVmmapCtor(&nap->mem_map)) { | 75 if (!NaClVmmapCtor(&nap->mem_map)) { |
| 76 goto cleanup_desc_tbl; | 76 goto cleanup_desc_tbl; |
| 77 } | 77 } |
| 78 | 78 |
| 79 nap->phdrs = NULL; | |
| 80 nap->service_port = NULL; | 79 nap->service_port = NULL; |
| 81 nap->service_address = NULL; | 80 nap->service_address = NULL; |
| 82 nap->secure_channel = NULL; | 81 nap->secure_channel = NULL; |
| 83 | 82 |
| 84 if (!NaClMutexCtor(&nap->mu)) { | 83 if (!NaClMutexCtor(&nap->mu)) { |
| 85 goto cleanup_mem_map; | 84 goto cleanup_mem_map; |
| 86 } | 85 } |
| 87 if (!NaClCondVarCtor(&nap->cv)) { | 86 if (!NaClCondVarCtor(&nap->cv)) { |
| 88 goto cleanup_mu; | 87 goto cleanup_mu; |
| 89 } | 88 } |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 return NACL_SRPC_RESULT_NO_MEMORY; | 804 return NACL_SRPC_RESULT_NO_MEMORY; |
| 806 } | 805 } |
| 807 UNREFERENCED_PARAMETER(out_args); | 806 UNREFERENCED_PARAMETER(out_args); |
| 808 | 807 |
| 809 if (!GioMemoryFileCtor(&gf, map_addr, rounded_size)) { | 808 if (!GioMemoryFileCtor(&gf, map_addr, rounded_size)) { |
| 810 return NACL_SRPC_RESULT_NO_MEMORY; | 809 return NACL_SRPC_RESULT_NO_MEMORY; |
| 811 } | 810 } |
| 812 | 811 |
| 813 errcode = NaClAppLoadFile((struct Gio *) &gf, | 812 errcode = NaClAppLoadFile((struct Gio *) &gf, |
| 814 nap, | 813 nap, |
| 815 NACL_ABI_MISMATCH_OPTION_ABORT); | 814 NACL_ABI_CHECK_OPTION_CHECK); |
| 816 if (LOAD_OK != errcode) { | 815 if (LOAD_OK != errcode) { |
| 817 nap->module_load_status = errcode; | 816 nap->module_load_status = errcode; |
| 818 return NACL_SRPC_RESULT_APP_ERROR; | 817 return NACL_SRPC_RESULT_APP_ERROR; |
| 819 } | 818 } |
| 820 | 819 |
| 821 GioMemoryFileDtor((struct Gio *)&gf); | 820 GioMemoryFileDtor((struct Gio *)&gf); |
| 822 | 821 |
| 823 /* | 822 /* |
| 824 * Finish setting up the NaCl App. This includes dup'ing | 823 * Finish setting up the NaCl App. This includes dup'ing |
| 825 * descriptors 0-2 and making them available to the NaCl App. | 824 * descriptors 0-2 and making them available to the NaCl App. |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 | 1093 |
| 1095 state.nap = nap; | 1094 state.nap = nap; |
| 1096 state.effp = (struct NaClDescEffector *) &eff; | 1095 state.effp = (struct NaClDescEffector *) &eff; |
| 1097 state.partial = 0; | 1096 state.partial = 0; |
| 1098 state.pbytes = 0; | 1097 state.pbytes = 0; |
| 1099 | 1098 |
| 1100 NaClDescEffectorCleanupCtor(&eff); | 1099 NaClDescEffectorCleanupCtor(&eff); |
| 1101 NaClVmmapVisit(&nap->mem_map, NaClAppFreeWalker, &state); | 1100 NaClVmmapVisit(&nap->mem_map, NaClAppFreeWalker, &state); |
| 1102 (*eff.base.vtbl->Dtor)(&eff.base); | 1101 (*eff.base.vtbl->Dtor)(&eff.base); |
| 1103 } | 1102 } |
| OLD | NEW |