summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaaira Gupta <kgupta@es.iitr.ac.in>2020-03-18 20:54:24 +0530
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-03-18 20:54:24 +0530
commit1eaf7407c2a787daecfc92dc7698a4176784ff07 (patch)
tree84f1bee07bb75acdeb722dff55f66fe848377f53
parent6afe116dcc3252a8b1a357de8d9d47dbc3895329 (diff)
libcamera: ipa_proxy: rearrange proxies precedence
User environment path in LIBCAMERA_IPA_PROXY_PATH should take precedence over system loading locations. Change precedence accordingly Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/libcamera/ipa_proxy.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp
index c7347c88..b409e1d4 100644
--- a/src/libcamera/ipa_proxy.cpp
+++ b/src/libcamera/ipa_proxy.cpp
@@ -75,13 +75,9 @@ IPAProxy::~IPAProxy()
*/
std::string IPAProxy::resolvePath(const std::string &file) const
{
- /* Try finding the exec target from the install directory first */
std::string proxyFile = "/" + file;
- std::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile;
- if (!access(proxyPath.c_str(), X_OK))
- return proxyPath;
- /* No exec target in install directory; check env variable. */
+ /* Check env variable first. */
const char *execPaths = utils::secure_getenv("LIBCAMERA_IPA_PROXY_PATH");
if (execPaths) {
for (const auto &dir : utils::split(execPaths, ":")) {
@@ -95,6 +91,11 @@ std::string IPAProxy::resolvePath(const std::string &file) const
}
}
+ /* Try finding the exec target from the install directory. */
+ std::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile;
+ if (!access(proxyPath.c_str(), X_OK))
+ return proxyPath;
+
return std::string();
}