Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Unified Diff: runtime/bin/extensions_fuchsia.cc

Issue 2986803002: [Fuchsia] Fixes and cleanup for launchpad_vmo_from_file() deprecation (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/process_fuchsia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/extensions_fuchsia.cc
diff --git a/runtime/bin/extensions_fuchsia.cc b/runtime/bin/extensions_fuchsia.cc
index cc80a5804fdd4dcc0f9800a658e89714cc4322ba..aea8dc3660d3ec079101cfecf398a25357d472d7 100644
--- a/runtime/bin/extensions_fuchsia.cc
+++ b/runtime/bin/extensions_fuchsia.cc
@@ -8,8 +8,10 @@
#include "bin/extensions.h"
#include <dlfcn.h>
+#include <fcntl.h>
#include <launchpad/vmo.h>
#include <magenta/dlfcn.h>
+#include <mxio/io.h>
#include "platform/assert.h"
@@ -23,8 +25,14 @@ const char* kIsolateSnapshotInstructionsSymbolName =
"_kDartIsolateSnapshotInstructions";
void* Extensions::LoadExtensionLibrary(const char* library_file) {
- mx_handle_t vmo = launchpad_vmo_from_file(library_file);
- if (vmo <= 0) {
+ int fd = open(library_file, O_RDONLY);
+ if (fd < 0) {
+ return NULL;
+ }
+ mx_handle_t vmo;
+ mx_status_t status = mxio_get_vmo(fd, &vmo);
+ close(fd);
+ if (status != MX_OK) {
return NULL;
}
return dlopen_vmo(vmo, RTLD_LAZY);
« no previous file with comments | « no previous file | runtime/bin/process_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698