From 7eef25c04b5e1d391714146ac0d717afdc617844 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Tue, 10 Aug 2021 17:21:38 +0000 Subject: [PATCH] rgw: fix install packages function remove_all() doesn't return bool, instead it returns static_cast(-1) on error. Signed-off-by: Matan Breizman --- src/rgw/rgw_lua.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_lua.cc b/src/rgw/rgw_lua.cc index bd08f06bcd9..46c194db987 100644 --- a/src/rgw/rgw_lua.cc +++ b/src/rgw/rgw_lua.cc @@ -198,7 +198,8 @@ int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Store* store, opti // luarocks directory cleanup std::error_code ec; const auto& luarocks_path = store->get_luarocks_path(); - if (!std::filesystem::remove_all(luarocks_path, ec) && + if (std::filesystem::remove_all(luarocks_path, ec) + == static_cast(-1) && ec != std::errc::no_such_file_or_directory) { output.append("failed to clear luarock directory: "); output.append(ec.message());