From 10e86c759c08e661e6b1bd0433df3a76cabea082 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 8 Nov 2023 17:26:04 +0100 Subject: [PATCH] Avoid running into exception when checking whether executable exists When we cannot even check whether the executable exists we can just assume it doesn't. --- librepomgr/buildactions/subprocess.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/librepomgr/buildactions/subprocess.h b/librepomgr/buildactions/subprocess.h index 9abe4ab..26cc54e 100644 --- a/librepomgr/buildactions/subprocess.h +++ b/librepomgr/buildactions/subprocess.h @@ -163,7 +163,8 @@ inline boost::filesystem::path findExecutable(const std::string &nameOrPath) inline bool checkExecutable(const boost::filesystem::path &path) { - return !path.empty() && boost::filesystem::exists(path); + auto ec = boost::system::error_code(); + return !path.empty() && boost::filesystem::exists(path, ec); } } // namespace LibRepoMgr