Changeset 241f1985 in mainline for uspace/srv/sysman/units


Ignore:
Timestamp:
2019-08-31T10:45:17Z (7 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

Location:
uspace/srv/sysman/units
Files:
3 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);
  • uspace/srv/sysman/units/unit_mnt.c

    rf92b315 r241f1985  
    130130}
    131131
    132 static int unit_mnt_load(unit_t *unit, ini_configuration_t *ini_conf,
     132static errno_t unit_mnt_load(unit_t *unit, ini_configuration_t *ini_conf,
    133133    text_parse_t *text_parse)
    134134{
     
    148148}
    149149
    150 static int mount_exec(void *arg)
     150static errno_t mount_exec(void *arg)
    151151{
    152152        mount_data_t *mnt_data = arg;
     
    156156            mnt_data->flags, mnt_data->instance);
    157157
    158         int rc = mount(mnt_data->type, mnt_data->mountpoint, mnt_data->device,
     158        errno_t rc = vfs_mount_path(mnt_data->type, mnt_data->mountpoint, mnt_data->device,
    159159            mnt_data->options ? mnt_data->options : "",
    160160            mnt_data->flags, mnt_data->instance);
     
    188188}
    189189
    190 static int unit_mnt_start(unit_t *unit)
     190static errno_t unit_mnt_start(unit_t *unit)
    191191{
    192192        unit_mnt_t *u_mnt = CAST_MNT(unit);
     
    228228}
    229229
    230 static int unit_mnt_stop(unit_t *unit)
     230static errno_t unit_mnt_stop(unit_t *unit)
    231231{
    232232        unit_mnt_t *u_mnt = CAST_MNT(unit);
     
    245245         * unmount synchronously in the event loop fibril.
    246246         */
    247         int rc = unmount(u_mnt->mountpoint);
     247        errno_t rc = vfs_unmount_path(u_mnt->mountpoint);
    248248
    249249        if (rc == EOK) {
  • uspace/srv/sysman/units/unit_svc.c

    rf92b315 r241f1985  
    3232#include <stdlib.h>
    3333#include <task.h>
     34#include <str.h>
    3435
    3536#include "log.h"
     
    5859}
    5960
    60 static int unit_svc_load(unit_t *unit, ini_configuration_t *ini_conf,
     61static errno_t unit_svc_load(unit_t *unit, ini_configuration_t *ini_conf,
    6162    text_parse_t *text_parse)
    6263{
     
    7677}
    7778
    78 static int unit_svc_start(unit_t *unit)
     79static errno_t unit_svc_start(unit_t *unit)
    7980{
    8081        unit_svc_t *u_svc = CAST_SVC(unit);
     
    8485        assert(unit->state == STATE_STOPPED);
    8586
    86         int rc = task_spawnv(&u_svc->main_task_id, NULL, u_svc->exec_start.path,
     87        errno_t rc = task_spawnv(&u_svc->main_task_id, NULL, u_svc->exec_start.path,
    8788            u_svc->exec_start.argv);
    8889
     
    100101         */
    101102        if (str_cmp(unit->name, "devman.svc") == 0) {
    102                 async_usleep(100000);
     103                fibril_usleep(100000);
    103104                if (console_kcon()) {
    104105                        sysman_log(LVL_DEBUG2, "%s: Kconsole grabbed.", __func__);
     
    111112}
    112113
    113 static int unit_svc_stop(unit_t *unit)
     114static errno_t unit_svc_stop(unit_t *unit)
    114115{
    115116        unit_svc_t *u_svc = CAST_SVC(unit);
     
    129130        }
    130131
    131         int rc = task_kill(u_svc->main_task_id);
     132        errno_t rc = task_kill(u_svc->main_task_id);
    132133
    133134        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.