chiark / gitweb /
pam: externally our booleans are ints, not unsigneds
[elogind.git] / src / fsck / fsck.c
index 5c21c7e41f26c2dbf5f8e1afc002caa01dd31b38..9b67ccfc0e278527c47abc64132f881effcb94cf 100644 (file)
@@ -35,7 +35,6 @@
 #include "bus-util.h"
 #include "bus-error.h"
 #include "bus-errors.h"
-#include "virt.h"
 #include "fileio.h"
 #include "udev-util.h"
 
@@ -44,13 +43,13 @@ static bool arg_force = false;
 static bool arg_show_progress = false;
 
 static void start_target(const char *target) {
-        _cleanup_bus_unref_ sd_bus *bus = NULL;
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+        _cleanup_bus_unref_ sd_bus *bus = NULL;
         int r;
 
         assert(target);
 
-        r = bus_connect_system(&bus);
+        r = bus_open_system_systemd(&bus);
         if (r < 0) {
                 log_error("Failed to get D-Bus connection: %s", strerror(-r));
                 return;
@@ -67,30 +66,22 @@ static void start_target(const char *target) {
                                &error,
                                NULL,
                                "sss", "basic.target", target, "replace");
-        if (r < 0) {
 
-                /* Don't print a warning if we aren't called during
-                 * startup */
-                if (!sd_bus_error_has_name(&error, BUS_ERROR_NO_SUCH_JOB))
-                        log_error("Failed to start unit: %s", bus_error_message(&error, -r));
-        }
-
-        return;
+        /* Don't print a warning if we aren't called during startup */
+        if (r < 0 && !sd_bus_error_has_name(&error, BUS_ERROR_NO_SUCH_JOB))
+                log_error("Failed to start unit: %s", bus_error_message(&error, -r));
 }
 
 static int parse_proc_cmdline(void) {
         char *line, *w, *state;
-        int r;
         size_t l;
+        int r;
 
-        if (detect_container(NULL) > 0)
-                return 0;
-
-        r = read_one_line_file("/proc/cmdline", &line);
-        if (r < 0) {
+        r = proc_cmdline(&line);
+        if (r < 0)
                 log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
+        if (r <= 0)
                 return 0;
-        }
 
         FOREACH_WORD_QUOTED(w, l, line, state) {