diff options
author | 2024-02-27 20:05:55 +0000 | |
---|---|---|
committer | 2024-02-28 13:06:47 +0000 | |
commit | d73181d1a08c777e34b5a81d197dbce87a679d47 (patch) | |
tree | 774e8ecc4c18e0d0b2fe759a25c197b4376b68c6 | |
parent | c62d3a210b2e53ee121e9ffbec24702e938cce04 (diff) |
Avoid repeated logging of the file name when ReadConfig returns an
error.
https://r.android.com/2963904 made ReadConfig include the file name in
the error if the file cannot be read, but some call sites added it as
well. Make it consistently the responsibility of ReadConfig.
Also shorten an error message where the path itself is good enough to
identify the call site.
Test: presubmits
Bug: 325107109
Change-Id: I0c7d6c0ea3a7fb5d2ba1fa6aa25557080ac4d630
-rw-r--r-- | libnativeloader/public_libraries.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libnativeloader/public_libraries.cpp b/libnativeloader/public_libraries.cpp index af965a09a9..390c2987d6 100644 --- a/libnativeloader/public_libraries.cpp +++ b/libnativeloader/public_libraries.cpp @@ -139,8 +139,8 @@ void ReadExtensionLibraries(const char* dirname, std::vector<std::string>* sonam if (ret.ok()) { sonames->insert(sonames->end(), ret->begin(), ret->end()); } else { - LOG_ALWAYS_FATAL("Error reading public native library list from \"%s\": %s", - config_file_path.c_str(), ret.error().message().c_str()); + LOG_ALWAYS_FATAL("Error reading extension library list: %s", + ret.error().message().c_str()); } } } @@ -158,8 +158,7 @@ static std::string InitDefaultPublicLibraries(bool for_preload) { } }); if (!sonames.ok()) { - LOG_ALWAYS_FATAL("Error reading public native library list from \"%s\": %s", - config_file.c_str(), sonames.error().message().c_str()); + LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str()); return ""; } @@ -252,7 +251,7 @@ static std::string InitLlndkLibrariesVendor() { } Result<std::vector<std::string>> sonames = ReadConfig(config_file, always_true); if (!sonames.ok()) { - LOG_ALWAYS_FATAL("%s: %s", config_file.c_str(), sonames.error().message().c_str()); + LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str()); return ""; } std::string libs = android::base::Join(*sonames, ':'); @@ -274,7 +273,7 @@ static std::string InitLlndkLibrariesProduct() { } Result<std::vector<std::string>> sonames = ReadConfig(config_file, always_true); if (!sonames.ok()) { - LOG_ALWAYS_FATAL("%s: %s", config_file.c_str(), sonames.error().message().c_str()); + LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str()); return ""; } std::string libs = android::base::Join(*sonames, ':'); |