save works

This commit is contained in:
Rongsong Shen 2026-03-04 18:18:53 +08:00
parent acfbec875b
commit 3f74f14687
38 changed files with 751 additions and 448 deletions

View file

@ -48,13 +48,14 @@ static typeinfo_t xconfig_type = {
.destroy = (obj_destroy_fn_t)xconfig_destroy,
};
xce_config_t* makeConfig(var configmgr, xce_config_t* c)
static xce_config_t* makeConfig_(var configmgr, xce_config_t* c)
{
xce_config_t* c1 = NULL;
int rc = 0;
rc = key_find(configmgr, (void*)c->name, (void**)&c1);
if ((rc < 0) && (rc != -ENOENT)) {
errno = -rc;
return NULL;
}
@ -77,3 +78,14 @@ xce_config_t* makeConfig(var configmgr, xce_config_t* c)
return c1;
}
xce_config_t* makeConfig(var configmgr, xce_config_t* c)
{
xce_config_t* c1 = NULL;
lock(configmgr, RTTI_LOCK_WRITE);
c1 = makeConfig_(configmgr, c);
unlock(configmgr);
return c1;
}