| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 #include "native_client/src/trusted/service_runtime/load_file.h" |
| 8 |
| 9 #include "native_client/src/shared/gio/gio.h" |
| 10 #include "native_client/src/trusted/service_runtime/nacl_valgrind_hooks.h" |
| 11 #include "native_client/src/trusted/service_runtime/sel_ldr.h" |
| 12 |
| 13 |
| 14 NaClErrorCode NaClAppLoadFileFromFilename(struct NaClApp *nap, |
| 15 const char *filename) { |
| 16 struct GioMemoryFileSnapshot gio_file; |
| 17 struct Gio *gio; |
| 18 NaClErrorCode err; |
| 19 |
| 20 NaClFileNameForValgrind(filename); |
| 21 |
| 22 if (!GioMemoryFileSnapshotCtor(&gio_file, filename)) { |
| 23 return LOAD_OPEN_ERROR; |
| 24 } |
| 25 gio = &gio_file.base.base; |
| 26 err = NaClAppLoadFile(gio, nap); |
| 27 if (err != LOAD_OK) { |
| 28 return err; |
| 29 } |
| 30 if (gio->vtbl->Close(gio) != 0) { |
| 31 err = LOAD_INTERNAL; |
| 32 } |
| 33 gio->vtbl->Dtor(gio); |
| 34 return err; |
| 35 } |
| OLD | NEW |