From patchwork Wed Mar 18 15:24:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 3172 Return-Path: Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3ABEB60418 for ; Wed, 18 Mar 2020 16:25:48 +0100 (CET) Received: by mail-pg1-x544.google.com with SMTP id z72so4020116pgz.3 for ; Wed, 18 Mar 2020 08:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=itDBIeaaPZusj+vur2FE0rTJTemOWFKe6rlSI4nlGL0=; b=O05Ydm1e0XEf2pbfCdqztn7i4FotYmNsLIgf9g2EBP/6Nk95sCSqFQvt9YR8igIuv3 fZ31aJMbIM2n9ClPYCXYO9cuxE9cG2Ss6/sDufoxJnifGm6IITJmsNpwQN4oVqJwTA/y xar+NLagcnXf/jcWPNthOgBCo8fhzGLZ97tAoSeZxqSCdZOXklSie58/l0tJsNRB9KqF WEwcbksNKxWYiJT2T/mHAqBjFnskjr5UMEe9e/YWtWgW1mqeoDXumGeFhrafI8v7f44h WAQ/i96s1uVfjodDNhOGdVZDq1s9pJQmW5t0fOz30SZxZIst0eCiZkOAusbCdi/7HCCJ oTEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=itDBIeaaPZusj+vur2FE0rTJTemOWFKe6rlSI4nlGL0=; b=lGspsLKaZryxGZ8z/m3rlT9AVBYh4dlLN0PZfaJdTdcSTQU1Q1DipHR6lJwC4V+quz uQtxS5PzNbKh29/szQQu5UdE1sld8K4HBMiAuDaSadwvMNp/uPxCphpC3kywERDOnzBv lSep9dieMKjlpblBeTBviPWFIdRxWhT3F1+lyxxHumH+5QZ+oTwZzMt1MNUn0bDRZDpT +jhrvsEKE+GqCRez1NZUS60ajGvR/9PR5i5ZfmyFX/uohMOA5uVQ82lrEIGlfh1h1imL 7mBqAeSG8PGhF1DfeDM2CBf3ZTFDK2epBuzaPGKaSE05CC94tHZslakffZ0ZHl6/Geyx 1ysQ== X-Gm-Message-State: ANhLgQ2gCFBuB1jtrTXOcXHp6U3rKiNKk40I0MbkGHGT9BN8fQqwUyVE uZ2i6SHOiYqn3Z/Fws6zUMbGPg== X-Google-Smtp-Source: ADFU+vsGwG+UwQv2yCXW57GsMnv8ThwonScdXv9Rlre7hv5dnwo7Qinyq4235N6f8cvCGWNKVpL2hg== X-Received: by 2002:a63:d7:: with SMTP id 206mr5015179pga.366.1584545146792; Wed, 18 Mar 2020 08:25:46 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.153]) by smtp.gmail.com with ESMTPSA id 127sm7036864pfb.130.2020.03.18.08.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 08:25:46 -0700 (PDT) From: Kaaira Gupta To: Vaishali Thakkar , Helen Koike , kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org Cc: Kaaira Gupta Date: Wed, 18 Mar 2020 20:54:24 +0530 Message-Id: <20200318152427.13126-3-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318152427.13126-1-kgupta@es.iitr.ac.in> References: <20200318152427.13126-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH LIBCAMERA v4 2/5] libcamera: ipa_proxy: rearrange proxies precedence X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 15:25:48 -0000 User environment path in LIBCAMERA_IPA_PROXY_PATH should take precedence over system loading locations. Change precedence accordingly Signed-off-by: Kaaira Gupta Reviewed-by: Kieran Bingham --- src/libcamera/ipa_proxy.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp index c7347c8..b409e1d 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(); }