Changeset 241f1985 in mainline for uspace/srv/sysman/units/unit_cfg.c


Ignore:
Timestamp:
2019-08-31T10:45:17Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
102f641
Parents:
f92b315
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-08-23 22:04:34)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-31 10:45:17)
Message:

Correcting failure from previous merge

The commits from Michal Koutný from the branch system-daemon
where built on a old version of Helenos. Because of this
many types and API functions have changed. This commit
upgrades the merge code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/units/unit_cfg.c

    rf92b315 r241f1985  
    5555 * @param[out]  unit_ptr   Unit loaded from the file. Undefined when function fails.
    5656 */
    57 static int cfg_parse_file(const char *dirname, const char *filename,
     57static errno_t cfg_parse_file(const char *dirname, const char *filename,
    5858    unit_t **unit_ptr)
    5959{
    60         int rc = EOK;
     60        errno_t rc = EOK;
    6161        unit_t *new_unit = NULL;
    6262        char *fn = NULL;
     
    8686        if (u != NULL) {
    8787                // TODO allow updating configuration of existing unit
    88                 rc = EEXISTS;
     88                rc = EEXIST;
    8989                goto finish;
    9090        } else {
     
    136136        list_foreach(text_parse.errors, link, text_parse_error_t, err) {
    137137                sysman_log(LVL_WARN,
    138                     "Error (%i) when parsing '%s' on line %i.",
     138                    "Error (%i) when parsing '%s' on line %lu.",
    139139                    err->parse_errno, fn, err->lineno);
    140140        }
     
    151151}
    152152
    153 static int cfg_load_configuration(const char *path)
     153static errno_t cfg_load_configuration(const char *path)
    154154{
    155155        DIR *dir;
     
    167167        while ((de = readdir(dir))) {
    168168                unit_t *unit = NULL;
    169                 int rc = cfg_parse_file(path, de->d_name, &unit);
     169                errno_t rc = cfg_parse_file(path, de->d_name, &unit);
    170170                if (rc != EOK) {
    171171                        sysman_log(LVL_WARN, "Cannot load unit from file %s/%s",
     
    183183        closedir(dir);
    184184
    185         int rc = repo_resolve_references();
     185        errno_t rc = repo_resolve_references();
    186186        if (rc != EOK) {
    187187                repo_rollback();
     
    207207}
    208208
    209 static int unit_cfg_load(unit_t *unit, ini_configuration_t *ini_conf,
     209static errno_t unit_cfg_load(unit_t *unit, ini_configuration_t *ini_conf,
    210210    text_parse_t *text_parse)
    211211{
     
    225225}
    226226
    227 static int unit_cfg_start(unit_t *unit)
    228 {
    229         unit_cfg_t *u_cfg = CAST_CFG(unit);
    230         assert(u_cfg);
    231 
    232         int rc = cfg_load_configuration(u_cfg->path);
     227static errno_t unit_cfg_start(unit_t *unit)
     228{
     229        unit_cfg_t *u_cfg = CAST_CFG(unit);
     230        assert(u_cfg);
     231
     232        errno_t rc = cfg_load_configuration(u_cfg->path);
    233233       
    234234        if (rc == EOK) {
     
    241241}
    242242
    243 static int unit_cfg_stop(unit_t *unit)
     243static errno_t unit_cfg_stop(unit_t *unit)
    244244{
    245245        unit_cfg_t *u_cfg = CAST_CFG(unit);
Note: See TracChangeset for help on using the changeset viewer.