X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmain.c;h=15bd2e4d1562bf14ad2089811e4845ae3ab05b41;hp=ee12e1f3aff7691bb25782539138ff19acbfac57;hb=2054a5b8cb52a66462b7d967ed9a6c179777bc0f;hpb=07459bb6b92268beb2599f65cf195708d88c51cc diff --git a/src/main.c b/src/main.c index ee12e1f3a..15bd2e4d1 100644 --- a/src/main.c +++ b/src/main.c @@ -73,11 +73,6 @@ static char *arg_console = NULL; static FILE* serialization = NULL; -_noreturn_ static void freeze(void) { - for (;;) - pause(); -} - static void nop_handler(int sig) { } @@ -550,11 +545,9 @@ static int parse_config_file(void) { } static int parse_proc_cmdline(void) { - char *line; + char *line, *w, *state; int r; - char *w; size_t l; - char *state; if ((r = read_one_line_file("/proc/cmdline", &line)) < 0) { log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r)); @@ -1065,8 +1058,10 @@ int main(int argc, char *argv[]) { if ((r = manager_load_unit(m, arg_default_unit, NULL, &error, &target)) < 0) { log_error("Failed to load default target: %s", bus_error(&error, r)); dbus_error_free(&error); - } else if (target->meta.load_state != UNIT_LOADED) + } else if (target->meta.load_state == UNIT_ERROR) log_error("Failed to load default target: %s", strerror(-target->meta.load_error)); + else if (target->meta.load_state == UNIT_MASKED) + log_error("Default target masked."); if (!target || target->meta.load_state != UNIT_LOADED) { log_info("Trying to load rescue target..."); @@ -1075,12 +1070,17 @@ int main(int argc, char *argv[]) { log_error("Failed to load rescue target: %s", bus_error(&error, r)); dbus_error_free(&error); goto finish; - } else if (target->meta.load_state != UNIT_LOADED) { + } else if (target->meta.load_state == UNIT_ERROR) { log_error("Failed to load rescue target: %s", strerror(-target->meta.load_error)); goto finish; + } else if (target->meta.load_state == UNIT_MASKED) { + log_error("Rescue target masked."); + goto finish; } } + assert(target->meta.load_state == UNIT_LOADED); + if (arg_action == ACTION_TEST) { printf("-> By units:\n"); manager_dump_units(m, stdout, "\t");