Start using std::filesystem::path for fusepath (#1522)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run

This commit is contained in:
trapexit 2025-09-17 23:51:16 -04:00 • committed by GitHub
parent f64ff9ca1e
commit 8c649d33ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
139 changed files with 1711 additions and 1663 deletions

View file

@ -25,7 +25,6 @@
#include "fuse.h"
#include <string>
#include <vector>
#include <unistd.h>
@ -34,14 +33,14 @@
static
int
_unlink_loop(const std::vector<Branch*> &branches_,
const char *fusepath_)
const fs::path &fusepath_)
{
Err err;
std::string fullpath;
fs::path fullpath;
for(const auto &branch : branches_)
{
fullpath = fs::path::make(branch->path,fusepath_);
fullpath = branch->path / fusepath_;
err = fs::unlink(fullpath);
}
@ -53,7 +52,7 @@ static
int
_unlink(const Policy::Action &unlinkPolicy_,
const Branches &branches_,
const char *fusepath_)
const fs::path &fusepath_)
{
int rv;
std::vector<Branch*> branches;
@ -68,10 +67,11 @@ _unlink(const Policy::Action &unlinkPolicy_,
int
FUSE::unlink(const char *fusepath_)
{
const fs::path fusepath{fusepath_};
const fuse_context *fc = fuse_get_context();
const ugid::Set ugid(fc->uid,fc->gid);
return ::_unlink(cfg.func.unlink.policy,
cfg.branches,
fusepath_);
fusepath);
}