X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmanager.c;h=f16621ac2bbe38837b41eb64f05f9321124edb50;hb=602c0e740f8290cc9c4f13f2eb4b23fbbd7a8d2b;hp=208b240ba130e8a7ebc1cfb87850963ba9b88d15;hpb=7fd1b19bc9e9f5574f2877936b8ac267c7706947;p=elogind.git diff --git a/src/core/manager.c b/src/core/manager.c index 208b240ba..f16621ac2 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -440,13 +440,10 @@ int manager_new(SystemdRunningAs running_as, Manager **_m) { if (!m) return -ENOMEM; - dual_timestamp_get(&m->userspace_timestamp); - if (detect_container(NULL) <= 0) { - dual_timestamp_from_monotonic(&m->kernel_timestamp, 0); #ifdef ENABLE_EFI + if (detect_container(NULL) <= 0) efi_get_boot_timestamps(&m->userspace_timestamp, &m->firmware_timestamp, &m->loader_timestamp); #endif - } m->running_as = running_as; m->name_data_slot = m->conn_data_slot = m->subscribed_data_slot = -1; @@ -806,11 +803,9 @@ static void manager_build_unit_path_cache(Manager *m) { goto fail; } - r = set_put(m->unit_path_cache, p); - if (r < 0) { - free(p); + r = set_consume(m->unit_path_cache, p); + if (r < 0) goto fail; - } } closedir(d); @@ -831,7 +826,9 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) { assert(m); + dual_timestamp_get(&m->generators_start_timestamp); manager_run_generators(m); + dual_timestamp_get(&m->generators_finish_timestamp); r = lookup_paths_init( &m->lookup_paths, m->running_as, true, @@ -850,7 +847,9 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) { m->n_reloading ++; /* First, enumerate what we can from all config files */ + dual_timestamp_get(&m->unitsload_start_timestamp); r = manager_enumerate(m); + dual_timestamp_get(&m->unitsload_finish_timestamp); /* Second, deserialize if there is something to deserialize */ if (serialization) { @@ -1042,7 +1041,8 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DB } } - if ((r = unit_add_name(ret, name)) < 0) { + r = unit_add_name(ret, name); + if (r < 0) { unit_free(ret); return r; } @@ -1383,7 +1383,7 @@ static int manager_process_signal_fd(Manager *m) { case SIGINT: if (m->running_as == SYSTEMD_SYSTEM) { - manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE); + manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE_IRREVERSIBLY); break; } @@ -2339,7 +2339,7 @@ void manager_reset_failed(Manager *m) { unit_reset_failed(u); } -bool manager_unit_pending_inactive(Manager *m, const char *name) { +bool manager_unit_inactive_or_pending(Manager *m, const char *name) { Unit *u; assert(m); @@ -2350,7 +2350,7 @@ bool manager_unit_pending_inactive(Manager *m, const char *name) { if (!u) return true; - return unit_pending_inactive(u); + return unit_inactive_or_pending(u); } void manager_check_finished(Manager *m) {