From d3c08f28a3e1611a527f835cd83c4b4600632083 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 22 Jun 2018 00:26:56 +0900 Subject: [PATCH] Don't emit warning on missing directories Some directories (e.g., /product/bin, etc.) in ld.config.txt may not exist in some devices. Since many of them are optional directories, don't emit warning when realpath() gives ENOENT for the paths. Test: m -j Change-Id: Ic4fa7db05bde53d3aa5df47291e83b4cdc09aa1f --- linker/linker_config.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp index f23ae8378..391c8a9bc 100644 --- a/linker/linker_config.cpp +++ b/linker/linker_config.cpp @@ -240,13 +240,16 @@ static bool parse_config_file(const char* ld_config_file_path, std::string resolved_path; if (realpath(value.c_str(), buf)) { resolved_path = buf; - } else { + } else if (errno != ENOENT) { DL_WARN("%s:%zd: warning: path \"%s\" couldn't be resolved: %s", ld_config_file_path, cp.lineno(), value.c_str(), strerror(errno)); resolved_path = value; + } else { + // ENOENT: no need to test if binary is under the path + continue; } if (file_is_under_dir(binary_realpath, resolved_path)) {