mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Further tweaks to config parsing and error reporting (#1559)
* Further tweaks to config parsing and error reporting * Fix static builds
This commit is contained in:
parent
ec16d07fba
commit
2412ae7316
12 changed files with 60 additions and 59 deletions
|
|
@ -119,37 +119,19 @@ _set_default_options(fuse_args *args_)
|
|||
SysLog::notice("not auto setting allow_other since not running as root");
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
_parse_and_process_kv_arg(const std::string &key_,
|
||||
const std::string &val_)
|
||||
{
|
||||
int rv;
|
||||
std::string key(key_);
|
||||
std::string val(val_);
|
||||
|
||||
if(cfg.has_key(key) == false)
|
||||
return 1;
|
||||
|
||||
rv = cfg.set(key,val);
|
||||
if(rv < 0)
|
||||
cfg.errs.push_back({-rv,key+'='+val});
|
||||
|
||||
return OPT_DISCARD;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
_process_opt(const std::string &arg_)
|
||||
{
|
||||
std::string key;
|
||||
std::string val;
|
||||
int rv;
|
||||
|
||||
str::splitkv(arg_,'=',&key,&val);
|
||||
key = str::trim(key);
|
||||
val = str::trim(val);
|
||||
rv = cfg.set(arg_);
|
||||
if(rv == -ENOATTR)
|
||||
return OPT_KEEP;
|
||||
if(rv < 0)
|
||||
cfg.errs.push_back({-rv,arg_});
|
||||
|
||||
return ::_parse_and_process_kv_arg(key,val);
|
||||
return OPT_DISCARD;
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue