chiark / gitweb /
Small cleanup
[elogind.git] / src / core / main.c
index f19e432d4a0b75851746cce028fbd261bafc2a61..ab2ac00d7636906ec95ecc6bd4c4aeed9812e5d5 100644 (file)
@@ -40,7 +40,7 @@
 #include "fdset.h"
 #include "special.h"
 #include "conf-parser.h"
-#include "bus-errors.h"
+#include "dbus-common.h"
 #include "missing.h"
 #include "label.h"
 #include "build.h"
@@ -522,9 +522,6 @@ static void strv_free_free(char ***l) {
 }
 
 static void free_join_controllers(void) {
-        if (!arg_join_controllers)
-                return;
-
         strv_free_free(arg_join_controllers);
         arg_join_controllers = NULL;
 }
@@ -666,7 +663,7 @@ static int parse_config_file(void) {
                 { NULL, NULL, NULL, 0, NULL }
         };
 
-        FILE _cleanup_fclose_ *f;
+        _cleanup_fclose_ FILE *f;
         const char *fn;
         int r;
 
@@ -688,7 +685,7 @@ static int parse_config_file(void) {
 }
 
 static int parse_proc_cmdline(void) {
-        char _cleanup_free_ *line = NULL;
+        _cleanup_free_ char *line = NULL;
         char *w, *state;
         int r;
         size_t l;
@@ -705,7 +702,7 @@ static int parse_proc_cmdline(void) {
         }
 
         FOREACH_WORD_QUOTED(w, l, line, state) {
-                char _cleanup_free_ *word;
+                _cleanup_free_ char *word;
 
                 word = strndup(w, l);
                 if (!word)
@@ -1219,14 +1216,14 @@ static int initialize_join_controllers(void) {
                 return -ENOMEM;
 
         arg_join_controllers[0] = strv_new("cpu", "cpuacct", NULL);
-        if (!arg_join_controllers[0])
-                return -ENOMEM;
-
         arg_join_controllers[1] = strv_new("net_cls", "net_prio", NULL);
-        if (!arg_join_controllers[1])
+        arg_join_controllers[2] = NULL;
+
+        if (!arg_join_controllers[0] || !arg_join_controllers[1]) {
+                free_join_controllers();
                 return -ENOMEM;
+        }
 
-        arg_join_controllers[2] = NULL;
         return 0;
 }
 
@@ -1683,7 +1680,7 @@ int main(int argc, char *argv[]) {
 
                 r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, false, &error, &default_unit_job);
                 if (r == -EPERM) {
-                        log_error("Default target could not be isolated, starting instead: %s", bus_error(&error, r));
+                        log_debug("Default target could not be isolated, starting instead: %s", bus_error(&error, r));
                         dbus_error_free(&error);
 
                         r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &error, &default_unit_job);