[libcamera-devel,v4,05/10] android: remove references to std::filesystem
diff mbox series

Message ID 20221027224135.348115-6-nicholas@rothemail.net
State Superseded
Headers show
Series
  • [libcamera-devel,v4,01/10] ipa: workaround libcxx duration limitation
Related show

Commit Message

Nicolas Dufresne via libcamera-devel Oct. 27, 2022, 10:41 p.m. UTC
From: Nicholas Roth <nicholas@rothemail.net>

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 <nicholas@rothemail.net>
---
 src/android/.camera_hal_config.cpp.swp | Bin 0 -> 16384 bytes
 src/android/camera_hal_config.cpp      |   9 ++++-----
 2 files changed, 4 insertions(+), 5 deletions(-)
 create mode 100644 src/android/.camera_hal_config.cpp.swp

Patch
diff mbox series

diff --git a/src/android/.camera_hal_config.cpp.swp b/src/android/.camera_hal_config.cpp.swp
new file mode 100644
index 0000000000000000000000000000000000000000..e6b7220ae345f309242d3d97dd369fe783e65ed6
GIT binary patch
literal 16384
zcmeI3TWlOx8OMjVp)92r1zy@baI!}3uI0VhQLAcVTe8<{XVs1E_!2dw)@pX<?0S;*
z%ywqhsc|AC9(VvkTLkR`O{E3_MJ??^RjC4rzCck?C7>@r)RYPYR0O1|Patvof9IUp
z8SmQ81(1-Km44pc*>nA$bG|v>cgFSN@yb#5Kz>xi>n=@u_m-39o45Vr<}cp8Pjfss
zSflG#d5Ltnwt1CgT49}Awowqt3saTZYGrQap+d`cxY6XUU*L}h+;fZ;F4awAoqI;X
z_soLfSe|QJ1$n8qX0&Ri>on|U-fXw8R%h~iqClbm6zBwv+yl33hek(=q{l$|Ap7|K
zl|-6Efkc5sfkc5sfkc5sfkc5sfkc7-BL#x?P1<MC-<wpQpH%N3>UqCeeb?3dQ$4?{
zugP1YK%zjRK%zjRK%zjRK%zj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BCfXBgOU=$Pq`Tg&qPd@`MgR|fiXo3bf2B^<fkh~HF
z5(N?k5(N?k5(N?k5(REhfph1g82g}&7>LiYskO){iG|UfPOF7r1UxhuM!%Oih(uW2
zH$A%!f7^D1A5N}s|CTu2%_bcecCU!J%k6aqF7#d@cN+nZZY-mg=Z<jTx56Nh3_?+&
zFmO=IH*6#dONa9Y?@0J`vi4Hf;bcSdN-X*<b45w^auu`ERqP9Wi&&co`!PCNkVQsE
z6?6)*DkX^$r86-}!jL$nMEI&-pJ`t2G_zEAdb^bJ5~D1;bXgq(kX-q2q{GCqa75^x
zS1ggTVS9dnQS6KUneZ%S2N5)7TbMNRj0d>_ufu5;?HujGsScf~z}?3uq^@CDa}&ZB
zl<Et=njEU(uq~*8%2S6*u^M9Y6orY&7AZ?bEEtFrky`4s2fiVvQ=LqXnn4+MJo6D*
zW(*WyA>_mm!gh9;-9qiCBUE2rmQE#$n5MW!*+pnZ*XQx^sB7_=meJJpMQ&L0PHR)e
zMPt3mmFMQm;@m>6I;l+D+tk^^X)$xQb@So0Se^~H<5*&*^>k0ppLpY>s4_I0nn4$Y
zFDt@|B%TmHK0UhCjk739v2<doG(R^}o31RfbnIWh^W^8F9a}q}IK>8Cb&VQ;kd$)6
zF-DkFOr7MhWrWx;xqIDi3e|03tPI5eSiKVn1;k_|H@sVh5Oj|+$gFkCp`45A_>sZC
z_dBM^eSa81L5DZt^KWn_h8hh*1O)$i&%HA?j=7MJ#&{2#$nYQX@;nq?J+lL!`h;WE
PK!gP7+;cZs4r~7c$v(c4

literal 0
HcmV?d00001

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 <filesystem>
 #include <stdlib.h>
 #include <string>
 
@@ -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 "