Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15a264e6 authored by Evan Ralston's avatar Evan Ralston
Browse files

Log errors from loading public libraries

Prevent the boot from failing silently if one of the public libraries
does not exist.

Test: Add invalid element to public libraries and observe log is emited
during boot failure.

Change-Id: I0425085a1cc081068954f327f15be853a3ccd553
parent 9cd890e9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -246,7 +246,9 @@ class LibraryNamespaces {
    // For now we rely on CTS test to catch things like this but
    // it should probably be addressed in the future.
    for (const auto& soname : sonames) {
      dlopen(soname.c_str(), RTLD_NOW | RTLD_NODELETE);
      LOG_ALWAYS_FATAL_IF(dlopen(soname.c_str(), RTLD_NOW | RTLD_NODELETE) == nullptr,
                          "Error preloading public library %s: %s",
                          soname.c_str(), dlerror());
    }

    public_libraries_ = base::Join(sonames, ':');