X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmanager.c;h=4c3264b3734b88bfd5fb62db4508dc049afd5823;hb=4104970ef78e40e976215cdb0d1b9170a213cc4b;hp=350f2f3882f4b91acd1980ee4863924e05bc3795;hpb=f0e62e89970b8c38eb07a9beebd277ce13a5fcc2;p=elogind.git diff --git a/src/core/manager.c b/src/core/manager.c index 350f2f388..4c3264b37 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -79,9 +79,6 @@ #include "bus-kernel.h" #include "time-util.h" -/* As soon as 5s passed since a unit was added to our GC queue, make sure to run a gc sweep */ -#define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC) - /* Initial delay and the interval for printing status messages about running jobs */ #define JOBS_IN_PROGRESS_WAIT_USEC (5*USEC_PER_SEC) #define JOBS_IN_PROGRESS_PERIOD_USEC (USEC_PER_SEC / 3) @@ -396,9 +393,6 @@ static int manager_setup_signals(Manager *m) { assert(m); - if (m->test_run) - return 0; - assert_se(sigaction(SIGCHLD, &sa, NULL) == 0); /* We make liberal use of realtime signals here. On @@ -735,13 +729,6 @@ static int manager_setup_kdbus(Manager *m) { } log_debug("Successfully set up kdbus on %s", p); - - /* Create the namespace directory here, so that the contents - * of that directory is not visible to non-root users. This is - * necessary to ensure that users cannot get access to busses - * of virtualized users when no UID namespacing is used. */ - if (m->running_as == SYSTEMD_SYSTEM) - mkdir_p_label("/dev/kdbus/domain", 0700); #endif return 0; @@ -902,11 +889,12 @@ static void manager_clear_jobs_and_units(Manager *m) { m->n_running_jobs = 0; } -void manager_free(Manager *m) { +Manager* manager_free(Manager *m) { UnitType c; int i; - assert(m); + if (!m) + return NULL; manager_clear_jobs_and_units(m); @@ -968,6 +956,7 @@ void manager_free(Manager *m) { hashmap_free(m->units_requiring_mounts_for); free(m); + return NULL; } int manager_enumerate(Manager *m) { @@ -2421,7 +2410,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) { m->kdbus_fd = fdset_remove(fds, fd); } - } else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0) + } else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) < 0) log_warning("Unknown serialization item '%s'", l); }