Changeset 241f1985 in mainline for uspace/srv/sysman/units/unit_cfg.c
- Timestamp:
- 2019-08-31T10:45:17Z (6 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/sysman/units/unit_cfg.c
rf92b315 r241f1985 55 55 * @param[out] unit_ptr Unit loaded from the file. Undefined when function fails. 56 56 */ 57 static int cfg_parse_file(const char *dirname, const char *filename,57 static errno_t cfg_parse_file(const char *dirname, const char *filename, 58 58 unit_t **unit_ptr) 59 59 { 60 int rc = EOK;60 errno_t rc = EOK; 61 61 unit_t *new_unit = NULL; 62 62 char *fn = NULL; … … 86 86 if (u != NULL) { 87 87 // TODO allow updating configuration of existing unit 88 rc = EEXIST S;88 rc = EEXIST; 89 89 goto finish; 90 90 } else { … … 136 136 list_foreach(text_parse.errors, link, text_parse_error_t, err) { 137 137 sysman_log(LVL_WARN, 138 "Error (%i) when parsing '%s' on line % i.",138 "Error (%i) when parsing '%s' on line %lu.", 139 139 err->parse_errno, fn, err->lineno); 140 140 } … … 151 151 } 152 152 153 static int cfg_load_configuration(const char *path)153 static errno_t cfg_load_configuration(const char *path) 154 154 { 155 155 DIR *dir; … … 167 167 while ((de = readdir(dir))) { 168 168 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); 170 170 if (rc != EOK) { 171 171 sysman_log(LVL_WARN, "Cannot load unit from file %s/%s", … … 183 183 closedir(dir); 184 184 185 int rc = repo_resolve_references();185 errno_t rc = repo_resolve_references(); 186 186 if (rc != EOK) { 187 187 repo_rollback(); … … 207 207 } 208 208 209 static int unit_cfg_load(unit_t *unit, ini_configuration_t *ini_conf,209 static errno_t unit_cfg_load(unit_t *unit, ini_configuration_t *ini_conf, 210 210 text_parse_t *text_parse) 211 211 { … … 225 225 } 226 226 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);227 static 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); 233 233 234 234 if (rc == EOK) { … … 241 241 } 242 242 243 static int unit_cfg_stop(unit_t *unit)243 static errno_t unit_cfg_stop(unit_t *unit) 244 244 { 245 245 unit_cfg_t *u_cfg = CAST_CFG(unit);
Note:
See TracChangeset
for help on using the changeset viewer.