From patchwork Thu Oct 27 05:55:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17694 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 25327BD16B for ; Thu, 27 Oct 2022 05:55:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D686162F81; Thu, 27 Oct 2022 07:55:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666850130; bh=VC4UXiQtmAqvM3MJoJ2zyKm2mTdDppUMqAGYempxtm8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=w6IxqA0cXV/XsOZutI6a32CMobHGYmXKaOhBLF15HcGw2q96wYXiU3quyMMjvTUar MR6ADoYkPApoeQ9J2WSf2Ae7tkDDsy6PZqF742gxhCr9DGFoxUGPPjpUoTYBSiEQFo YcjirKG4OWAQ47FPLinVUJxBkfF2M6PSs3a7mOml0SOyAhi/vXfeJJbFxabWm8RPfg 8R2KtY0zdtwJvcgpDTGBDDcaY0u6N2mk3becAH5XLWRg7nVuFCgmbiQd9S6RIyLhyV zgpW7TCm2JuiMxM5UTTB4dQZGdU5O2d3IexYD74F8Zi2zePKkmY2j7qlwE38MtcxH8 kM1KDmT1TjfZw== Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 777FA62F72 for ; Thu, 27 Oct 2022 07:55:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="LwlKYPba"; dkim-atps=neutral Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1322d768ba7so686373fac.5 for ; Wed, 26 Oct 2022 22:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=hXexP+WvSpiEJbh2BQUsXDVGOmbAlgv40vpUmNc+sDs=; b=LwlKYPbaT/aTkWedHZMtDnEbJ2yLxt1YlYlkeoC58oCCKwrcMeo74bAfbrEIYiFglS A1/oLx5HfvJj/+hg3GzokVaHyJtWtKfBFG4cC7A5I7wEoqICSbJBRlgAXBbJRQo75i/B MPRM6S9i1M/jx8HxXf6OdiZMuW5M9KWDgyF+VyfHDcmwdAN6mizlzeMeXVXd3AwbBM+Q YRF0QfCRv2/NvliQq+2j/qymNc/3dZI1UGHjEey+ThFxtdT9l79mkSc0zIbaPrAne3N3 ae3bBdfWC1PLFSxRQfBqvtV/8E5yjoJEOLWHqQEviO/0hDMoS0nhLf9MhMW/luBmlY4b nkzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hXexP+WvSpiEJbh2BQUsXDVGOmbAlgv40vpUmNc+sDs=; b=WX9NUVnDtYfb5sKfYcZSwgshy7XRJy9huNrxF8gupEdYfKVUR2rTG54r9awfqIXPTx q2m9yGai9rXkLnY20aUJenwPw12IAB2M9wWP0KtcX5wJVsh+e53A0AtYcL88fOCX0N60 Oer8degBWGy1XdaFpmEqrjaMYoM7XOT5qcbodvR/F1y26btYpAdBOISaaGH7Pn8OlbET +iyvdAdBPT3kXRtjei8dXZtmokXBYTtvyoIne+jD1H/PTUk4M4V8fi41W2A+cl5NaKl8 I8aChp3wbCL49BL5B02TEi8N38h23s33me95QULAdknL+8IShbObO4jd9PwVBlPJo+A/ TsAw== X-Gm-Message-State: ACrzQf1WNtFAzLXaPIIzoHZ+Y5fS6DN8f1WKNN8RWK0NHppnCohLfQbT h7YiQxF7YGT65KbvdVPrLYhSsqQEVEjdNmOZ X-Google-Smtp-Source: AMsMyM5fGxaTbJq+MJGlku5ABtHXEqy3pFNPHESFcW1jYsxNKJYJxBZMqq4LqokNUoNmDfAIk5UyyA== X-Received: by 2002:a05:6870:d18f:b0:13b:a366:f448 with SMTP id a15-20020a056870d18f00b0013ba366f448mr4480755oac.209.1666850124742; Wed, 26 Oct 2022 22:55:24 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6406:fc7a:e46d:1666]) by smtp.gmail.com with ESMTPSA id 9-20020a9d0c09000000b00661a05691fasm140021otr.79.2022.10.26.22.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 22:55:24 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 00:55:10 -0500 Message-Id: <20221027055515.321791-6-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027055515.321791-1-nicholas@rothemail.net> References: <20221027055515.321791-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/10] android: remove references to std::filesystem 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-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Android 11's toolchain does not support std::filesystem, but camera_hal_config.cpp currently uses it. Remove references to std::filesystem in order to support Android <= 11. This adds a very small difference in behaviour, as File::exist() will return true for special files (pipes, character or block devices, ...) while std::filesystem::is_regular_file() doesn't, but I consider this to be a corner case that doesn't matter much. Signed-off-by: Nicholas Roth Reviewed-by: Jacopo Mondi --- src/android/camera_hal_config.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp index bacfe4b9..6fd71162 100644 --- a/src/android/camera_hal_config.cpp +++ b/src/android/camera_hal_config.cpp @@ -6,7 +6,6 @@ */ #include "camera_hal_config.h" -#include #include #include @@ -160,15 +159,15 @@ CameraHalConfig::CameraHalConfig() */ int CameraHalConfig::parseConfigurationFile() { - std::filesystem::path filePath = LIBCAMERA_SYSCONF_DIR; - filePath /= "camera_hal.yaml"; - if (!std::filesystem::is_regular_file(filePath)) { + std::string filePath = LIBCAMERA_SYSCONF_DIR "/camera_hal.yaml"; + + File file(filePath); + if (!file.exists()) { LOG(HALConfig, Debug) - << "Configuration file: \"" << filePath << "\" not found"; + << "Configuration file: \"" << filePath << "\" not found"; return -ENOENT; } - File file(filePath); if (!file.open(File::OpenModeFlag::ReadOnly)) { int ret = file.error(); LOG(HALConfig, Error) << "Failed to open configuration file "