diff --git a/runtime/bin/directory_fuchsia.cc b/runtime/bin/directory_fuchsia.cc index 4b7107874ae..737d1d0002d 100644 --- a/runtime/bin/directory_fuchsia.cc +++ b/runtime/bin/directory_fuchsia.cc @@ -7,15 +7,14 @@ #include "bin/directory.h" -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include // NOLINT -#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT #include "bin/crypto.h" #include "bin/dartutils.h" diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc index 4c6a1688ea1..6d0b568ce73 100644 --- a/runtime/bin/process_fuchsia.cc +++ b/runtime/bin/process_fuchsia.cc @@ -586,24 +586,18 @@ class ProcessStarter { NamespaceScope ns(namespc_, path_); int pathfd = -1; zx_status_t status; + constexpr fuchsia::io::Flags kFlags = + fuchsia::io::PERM_READABLE | fuchsia::io::PERM_EXECUTABLE; if (ns.fd() == AT_FDCWD) { - status = fdio_open_fd( - ns.path(), - static_cast(fuchsia::io::OpenFlags::RIGHT_READABLE | - fuchsia::io::OpenFlags::RIGHT_EXECUTABLE), - &pathfd); + status = fdio_open3_fd(ns.path(), uint64_t{kFlags}, &pathfd); } else { - status = fdio_open_fd_at( - ns.fd(), ns.path(), - static_cast(fuchsia::io::OpenFlags::RIGHT_READABLE | - fuchsia::io::OpenFlags::RIGHT_EXECUTABLE), - &pathfd); + status = fdio_open3_fd_at(ns.fd(), ns.path(), uint64_t{kFlags}, &pathfd); } if (status != ZX_OK) { close(exit_pipe_fds[0]); close(exit_pipe_fds[1]); ReportStartError( - "Failed to load executable for process start (fdio_open_fd_at %s).", + "Failed to load executable for process start (fdio_open3_fd_at %s).", zx_status_get_string(status)); return status; } diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc index 4a02c56a0e3..9ecd17d9154 100644 --- a/runtime/platform/utils.cc +++ b/runtime/platform/utils.cc @@ -306,10 +306,10 @@ void* Utils::LoadDynamicLibrary(const char* library_path, if (handle == nullptr) { // Fuchsia's search path is different. // https://fuchsia.dev/fuchsia-src/concepts/process/program_loading#zircons_standard_elf_dynamic_linker - fuchsia::io::Flags flags = + constexpr fuchsia::io::Flags kFlags = fuchsia::io::PERM_READABLE | fuchsia::io::PERM_EXECUTABLE; int fd = -1; - zx_status_t status = fdio_open3_fd(library_path, uint64_t{flags}, &fd); + zx_status_t status = fdio_open3_fd(library_path, uint64_t{kFlags}, &fd); if (status != ZX_OK) { *error = strdup(zx_status_get_string(status)); return nullptr;