Changeset 88ad75f in mainline
- Timestamp:
- 2020-01-09T01:04:57Z (5 years ago)
- Children:
- 76c8209
- Parents:
- 0939097
- git-author:
- Matthieu Riolo <matthieu.riolo@…> (2020-01-05 19:24:23)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2020-01-09 01:04:57)
- Location:
- uspace/srv/sysman
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/sysman/main.c
r0939097 r88ad75f 135 135 repo_begin_update(); 136 136 137 repo_add_unit(mnt_initrd); 138 repo_add_unit(cfg_init); 139 repo_add_unit(tgt_init); 137 rc = repo_add_unit(mnt_initrd); 138 if (rc != EOK) 139 goto rollback; 140 rc = repo_add_unit(cfg_init); 141 if (rc != EOK) 142 goto rollback; 143 rc = repo_add_unit(tgt_init); 144 if (rc != EOK) 145 goto rollback; 140 146 141 147 rc = edge_connect(tgt_init, cfg_init); 142 if (rc != EOK) { 143 goto rollback; 144 } 148 if (rc != EOK) 149 goto rollback; 145 150 146 151 rc = edge_connect(cfg_init, mnt_initrd); 147 if (rc != EOK) { 148 goto rollback; 149 } 152 if (rc != EOK) 153 goto rollback; 150 154 151 155 repo_commit(); 152 153 156 return EOK; 154 157 -
uspace/srv/sysman/test/job_closure.c
r0939097 r88ad75f 245 245 repo_begin_update(); 246 246 for (int i = 0; i < 7; ++i) { 247 repo_add_unit(mock_units[UNIT_SERVICE][i]); 247 errno_t rc = repo_add_unit(mock_units[UNIT_SERVICE][i]); 248 PCUT_ASSERT_INT_EQUALS(EOK, rc); 248 249 } 249 250 repo_commit(); -
uspace/srv/sysman/units/unit_cfg.c
r0939097 r88ad75f 155 155 DIR *dir; 156 156 struct dirent *de; 157 errno_t rc; 157 158 158 159 dir = opendir(path); … … 167 168 while ((de = readdir(dir))) { 168 169 unit_t *unit = NULL; 169 errno_trc = cfg_parse_file(path, de->d_name, &unit);170 rc = cfg_parse_file(path, de->d_name, &unit); 170 171 if (rc != EOK) { 171 172 sysman_log(LVL_WARN, "Cannot load unit from file %s/%s", … … 179 180 180 181 assert(unit->repo_state == REPO_EMBRYO); 181 repo_add_unit(unit); 182 rc = repo_add_unit(unit); 183 if (rc != EOK) 184 goto error; 185 182 186 } 183 187 closedir(dir); 184 188 185 errno_t rc = repo_resolve_references(); 186 if (rc != EOK) { 187 repo_rollback(); 188 return rc; 189 } 189 rc = repo_resolve_references(); 190 if (rc != EOK) 191 goto error; 190 192 191 193 repo_commit(); 192 194 return EOK; 195 196 error: 197 repo_rollback(); 198 return rc; 193 199 } 194 200
Note:
See TracChangeset
for help on using the changeset viewer.