From patchwork Fri Oct 28 03:17:21 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: 17717 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 6C929BD16B for ; Fri, 28 Oct 2022 03:17:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 186D962FBE; Fri, 28 Oct 2022 05:17:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666927062; bh=sX1r6Ne5eEwF5zJZASR+vpq0X820AepDT5mhE6+pR0Y=; 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=OIn+8KKqIeBT/PN7e0nMtgIsiX/4ha6MOYBuEI7Vv4FFOSVG6sC7S8NKx+yQQnLEe leENq5idXatKKJdTwcaYGsmFBDD/mx5xsFI/IFDZXy9Os48VnwOeL6JtoftY+awLaD o5dMmWpa6GmrbGkC7Q/tQ40lFB7RsKpB6c48qWw2EL6YPpBGwvQzjjqp+nvchm2CVY IptW5GqY4F7FZUbFvJ/+/hwtYeg9YojL6WP9q5l0lNq/QSKP3SSf2rpa8XxtrW0O5y kklYWABOcKoRHUlGr7nFcZ4VqjiAdMJ3nO/RVLvcPv2R9qskcJ0g67RFi1xTX+grF9 fzvbyzuTcGzZw== Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DA37962FAF for ; Fri, 28 Oct 2022 05:17:34 +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="vgUrq4Hd"; dkim-atps=neutral Received: by mail-oi1-x22b.google.com with SMTP id r83so4923338oih.2 for ; Thu, 27 Oct 2022 20:17:34 -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=ZTPVpdQPJ0vurOhdlddImO+6D58jD4bRP983l5lu4lc=; b=vgUrq4HdbQvNLcqT0Oa/o0OPhMUjNBuSA/Nx37+VlFrdOCqocB8ClIg+S1tJWjKdbh TQu7I5xP2El0CozDxo+O8xbaSudyAjIKpPkTO/WM2tZE8RqxRDLFXSAWG7ffF/B7ItPG zpNN27fyd5dPkFgN+CG1skdHcmScou4+UxT4NztD4XfZZeBwQDkVXOhjNvhK2H6EzxpR rM1MLTwXiRy7kocgp+AAT6XOMhy2zpzWgmeI20SoRohwy6G6ut2T7c4/h6NcWv9TTmrU W0WGLSPATd0agf77/K+4hFsk8ypGeZHSM26DclrH3EplWI5QwtFhYGyeWe9wwpgPeW9t +msQ== 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=ZTPVpdQPJ0vurOhdlddImO+6D58jD4bRP983l5lu4lc=; b=pFOXFkfbTkJnChb95smCUPRHZ1i9v/OJhRoyun2ZGbmQ2olhQ6OvYdOpFFD4loqwZl wHE5vZEVs7xg1UpyWQcKR4H5XB+jBXmgMshj+BCVb/rcDdytxtFbFExgaBuYH1O+bV+9 qZVOo5saicIXbF412hhxlcs91234U3qMLI9X654ZC7csdQLs0pvZzoRey1uW11JGT+kz ozrVs/L0Wc8glbZUIPvDB7n7zgJuyjd3q4ZtXj4udVM70fAiZMfdvQqh9r0FAz32itnA otgNsaq5YMfIz9LdI+Dxg4Hm3NmHRBMAjjlDAb3eiOo0sRuhwE0ShCtBm2dy75S+7+Dg R4kA== X-Gm-Message-State: ACrzQf0xftdwTrcmA9pAdGgOIkR7s/EkJfbcIUhKKXdGgXrU8P8GTF/y najUYCKtOgRmL+OXo7/9jfYtEtThWlb6drT7O38= X-Google-Smtp-Source: AMsMyM6GB5Qy4n1T021VviGyKbTAikROTlthHLxCsW/OCVllFKTpF+NeTIqiAUQ1AqMvfEGPzcuMjw== X-Received: by 2002:a05:6808:1209:b0:353:92d1:2a0 with SMTP id a9-20020a056808120900b0035392d102a0mr6863774oil.51.1666927053043; Thu, 27 Oct 2022 20:17:33 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:293a:90ce:6463:244d]) by smtp.gmail.com with ESMTPSA id fp19-20020a056870659300b0013626c1a5f6sm1527738oab.10.2022.10.27.20.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 20:17:32 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 22:17:21 -0500 Message-Id: <20221028031726.4849-6-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028031726.4849-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> <20221028031726.4849-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 Reviewed-by: Kieran Bingham --- src/android/camera_hal_config.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp index bacfe4b9..0e7cde63 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"; return -ENOENT; } - File file(filePath); if (!file.open(File::OpenModeFlag::ReadOnly)) { int ret = file.error(); LOG(HALConfig, Error) << "Failed to open configuration file "