chiark / gitweb /
Prep v238: Mask cg_trim() call in manager_shutdown_cgroup() as elogind is not init.
authorSven Eden <yamakuzure@gmx.net>
Wed, 6 Jun 2018 05:37:14 +0000 (07:37 +0200)
committerSven Eden <yamakuzure@gmx.net>
Thu, 28 Jun 2018 07:24:07 +0000 (09:24 +0200)
src/basic/macro.h
src/core/cgroup.c

index 1c64ea195454c83be004318b0ce1ee988d637830..3a6fc6f585beb89c8a5cb605036e95cab4b2ef6b 100644 (file)
@@ -423,7 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
 #endif
 #endif
 
-#else
 #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func)                 \
         static inline void func##p(type *p) {                   \
                 if (*p)                                         \
index 1dd17d3e7ce7e61c0d1d1c779164b66a2cdcb46b..7c590a661fe1382e02e74e4ee58225ca40a954fc 100644 (file)
@@ -2310,16 +2310,16 @@ int manager_setup_cgroup(Manager *m) {
 #endif // 0
         log_debug_elogind("Created control group \"%s\"", scope_path);
 
-#if 0 /// elogind is not a "sub-controller" like systemd, so migration is not needed.
-#endif // 0
                 /* 6. And pin it, so that it cannot be unmounted */
                 safe_close(m->pin_cgroupfs_fd);
                 m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK);
                 if (m->pin_cgroupfs_fd < 0)
                         return log_error_errno(errno, "Failed to open pin file: %m");
 
+#if 0 /// this is from the cgroup migration above that elogind does not need.
         } else if (r < 0 && !m->test_run_flags)
                 return log_error_errno(r, "Failed to create %s control group: %m", scope_path);
+#endif // 0
 
         /* 7. Always enable hierarchical support if it exists... */
         if (!all_unified && m->test_run_flags == 0)
@@ -2338,12 +2338,12 @@ int manager_setup_cgroup(Manager *m) {
 void manager_shutdown_cgroup(Manager *m, bool delete) {
         assert(m);
 
+#if 0 /// elogind is not init
         /* We can't really delete the group, since we are in it. But
          * let's trim it. */
         if (delete && m->cgroup_root && m->test_run_flags != MANAGER_TEST_RUN_MINIMAL)
                 (void) cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false);
 
-#if 0 /// elogind is not init
         m->cgroup_empty_event_source = sd_event_source_unref(m->cgroup_empty_event_source);
 
         m->cgroup_inotify_wd_unit = hashmap_free(m->cgroup_inotify_wd_unit);