chiark / gitweb /
manager: only issue overmount warning when the check succeeded
[elogind.git] / src / core / main.c
index 59a2be97f3bcabc6571ce5c9b94489863bae0676..b44e7f9cddb3f3754e420f6fffab303c8b21aa20 100644 (file)
@@ -75,9 +75,7 @@
 #include "selinux-setup.h"
 #include "ima-setup.h"
 #include "smack-setup.h"
-#ifdef HAVE_KMOD
 #include "kmod-setup.h"
-#endif
 
 static enum {
         ACTION_RUN,
@@ -1389,10 +1387,10 @@ int main(int argc, char *argv[]) {
         /* Mount /proc, /sys and friends, so that /proc/cmdline and
          * /proc/$PID/fd is available. */
         if (getpid() == 1) {
-#ifdef HAVE_KMOD
+
+                /* Load the kernel modules early, so that we kdbus.ko is loaded before kdbusfs shall be mounted */
                 if (!skip_setup)
                         kmod_setup();
-#endif
 
                 r = mount_setup(loaded_policy);
                 if (r < 0)
@@ -1801,10 +1799,7 @@ int main(int argc, char *argv[]) {
 finish:
         pager_close();
 
-        if (m) {
-                manager_free(m);
-                m = NULL;
-        }
+        m = manager_free(m);
 
         for (j = 0; j < ELEMENTSOF(arg_default_rlimit); j++) {
                 free(arg_default_rlimit[j]);