chiark / gitweb /
conf-parser: don't unescape parsed configuration strings by default
[elogind.git] / src / core / unit.c
index 8246837658251a100215d28bb322e6032b6dca6f..be0d654bbc001bcfb94c9750c0700bece380236d 100644 (file)
@@ -258,6 +258,9 @@ bool unit_check_gc(Unit *u) {
         if (unit_active_state(u) != UNIT_INACTIVE)
                 return true;
 
+        if (u->refs)
+                return true;
+
         if (UNIT_VTABLE(u)->check_gc)
                 if (UNIT_VTABLE(u)->check_gc(u))
                         return true;
@@ -1004,6 +1007,9 @@ static void unit_status_log_starting_stopping_reloading(Unit *u, JobType t) {
         if (t != JOB_START && t != JOB_STOP && t != JOB_RELOAD)
                 return;
 
+        if (log_on_console())
+                return;
+
         /* We log status messages for all units and all operations. */
 
         format = unit_get_status_message_format_try_harder(u, t);
@@ -1321,7 +1327,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
         /* Note that this is called for all low-level state changes,
          * even if they might map to the same high-level
          * UnitActiveState! That means that ns == os is OK an expected
-         * behaviour here. For example: if a mount point is remounted
+         * behavior here. For example: if a mount point is remounted
          * this function will be called too! */
 
         if (u->manager->n_reloading <= 0) {
@@ -2669,16 +2675,18 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
 
         r = manager_load_unit(u->manager, e, NULL, NULL, &device);
         free(e);
-
         if (r < 0)
                 return r;
 
-        if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true)) < 0)
+        r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true);
+        if (r < 0)
                 return r;
 
-        if (wants)
-                if ((r = unit_add_dependency(device, UNIT_WANTS, u, false)) < 0)
+        if (wants) {
+                r = unit_add_dependency(device, UNIT_WANTS, u, false);
+                if (r < 0)
                         return r;
+        }
 
         return 0;
 }