int main(int argc, char *argv[]) { bool enabled; int r; r = parse_argv(argc, argv); if (r <= 0) goto finish; log_set_target(LOG_TARGET_AUTO); log_parse_environment(); log_open(); umask(0022); r = proc_cmdline_get_bool("systemd.firstboot", &enabled); if (r < 0) { log_error_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring: %m"); goto finish; } if (r > 0 && !enabled) { r = 0; /* disabled */ goto finish; } r = process_locale(); if (r < 0) goto finish; r = process_keymap(); if (r < 0) goto finish; r = process_timezone(); if (r < 0) goto finish; r = process_hostname(); if (r < 0) goto finish; r = process_machine_id(); if (r < 0) goto finish; r = process_root_password(); if (r < 0) goto finish; finish: free(arg_root); free(arg_locale); free(arg_locale_messages); free(arg_keymap); free(arg_timezone); free(arg_hostname); string_erase(arg_root_password); free(arg_root_password); return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; }
X11KeysymEnum::X11KeysymEnum() : EnumBox<int>("X11Keysym") { Display* dpy = XOpenDisplay(NULL); if (!dpy) { log_error("unable to open X11 display, X11 keynames will not be available"); } else { process_keymap(dpy); XCloseDisplay(dpy); } }
static int run(int argc, char *argv[]) { bool enabled; int r; r = parse_argv(argc, argv); if (r <= 0) return r; log_setup_service(); umask(0022); r = proc_cmdline_get_bool("systemd.firstboot", &enabled); if (r < 0) return log_error_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring: %m"); if (r > 0 && !enabled) return 0; /* disabled */ r = process_locale(); if (r < 0) return r; r = process_keymap(); if (r < 0) return r; r = process_timezone(); if (r < 0) return r; r = process_hostname(); if (r < 0) return r; r = process_machine_id(); if (r < 0) return r; r = process_root_password(); if (r < 0) return r; return 0; }