diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-10 20:36:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-10 21:03:49 +0100 |
commit | ba64af90ecf48f7653a04bf3af1291385c9a69b8 (patch) | |
tree | 855c8d714b9bbaf40a3af73c1341b6553f35c19e /src/core/manager.c | |
parent | 1e603a482f57edb1fb863dbf23b868cf5854e004 (diff) |
core: change return value of the unit's enumerate() call to void
We cannot handle enumeration failures in a sensible way, hence let's try
hard to continue without making such failures fatal, and log about it
with precise error messages.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 7c3a020c4a..dbe11c2b4d 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -993,8 +993,7 @@ Manager* manager_free(Manager *m) { return NULL; } -int manager_enumerate(Manager *m) { - int r = 0; +void manager_enumerate(Manager *m) { UnitType c; assert(m); @@ -1002,8 +1001,6 @@ int manager_enumerate(Manager *m) { /* Let's ask every type to load all units from disk/kernel * that it might know */ for (c = 0; c < _UNIT_TYPE_MAX; c++) { - int q; - if (!unit_type_supported(c)) { log_debug("Unit type .%s is not supported on this system.", unit_type_to_string(c)); continue; @@ -1012,13 +1009,10 @@ int manager_enumerate(Manager *m) { if (!unit_vtable[c]->enumerate) continue; - q = unit_vtable[c]->enumerate(m); - if (q < 0) - r = q; + unit_vtable[c]->enumerate(m); } manager_dispatch_load_queue(m); - return r; } static void manager_coldplug(Manager *m) { @@ -1152,7 +1146,7 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) { /* First, enumerate what we can from all config files */ dual_timestamp_get(&m->units_load_start_timestamp); - r = manager_enumerate(m); + manager_enumerate(m); dual_timestamp_get(&m->units_load_finish_timestamp); /* Second, deserialize if there is something to deserialize */ @@ -2554,9 +2548,7 @@ int manager_reload(Manager *m) { manager_build_unit_path_cache(m); /* First, enumerate what we can from all config files */ - q = manager_enumerate(m); - if (q < 0 && r >= 0) - r = q; + manager_enumerate(m); /* Second, deserialize our stored data */ q = manager_deserialize(m, f, fds); |