#include "label.h"
#include "build.h"
#include "strv.h"
+#include "def.h"
static enum {
ACTION_RUN,
static const char * const rlmap[] = {
"emergency", SPECIAL_EMERGENCY_TARGET,
"-b", SPECIAL_EMERGENCY_TARGET,
- "b", SPECIAL_EMERGENCY_TARGET,
"single", SPECIAL_RESCUE_TARGET,
"-s", SPECIAL_RESCUE_TARGET,
"s", SPECIAL_RESCUE_TARGET,
unsigned line,
const char *section,
const char *lvalue,
+ int ltype,
const char *rvalue,
void *data,
void *userdata) {
unsigned line,
const char *section,
const char *lvalue,
+ int ltype,
const char *rvalue,
void *data,
void *userdata) {
unsigned line,
const char *section,
const char *lvalue,
+ int ltype,
const char *rvalue,
void *data,
void *userdata) {
unsigned line,
const char *section,
const char *lvalue,
+ int ltype,
const char *rvalue,
void *data,
void *userdata) {
unsigned line,
const char *section,
const char *lvalue,
+ int ltype,
const char *rvalue,
void *data,
void *userdata) {
static int parse_config_file(void) {
const ConfigItem items[] = {
- { "LogLevel", config_parse_level, NULL, "Manager" },
- { "LogTarget", config_parse_target, NULL, "Manager" },
- { "LogColor", config_parse_color, NULL, "Manager" },
- { "LogLocation", config_parse_location, NULL, "Manager" },
- { "DumpCore", config_parse_bool, &arg_dump_core, "Manager" },
- { "CrashShell", config_parse_bool, &arg_crash_shell, "Manager" },
- { "ShowStatus", config_parse_bool, &arg_show_status, "Manager" },
+ { "LogLevel", config_parse_level, 0, NULL, "Manager" },
+ { "LogTarget", config_parse_target, 0, NULL, "Manager" },
+ { "LogColor", config_parse_color, 0, NULL, "Manager" },
+ { "LogLocation", config_parse_location, 0, NULL, "Manager" },
+ { "DumpCore", config_parse_bool, 0, &arg_dump_core, "Manager" },
+ { "CrashShell", config_parse_bool, 0, &arg_crash_shell, "Manager" },
+ { "ShowStatus", config_parse_bool, 0, &arg_show_status, "Manager" },
#ifdef HAVE_SYSV_COMPAT
- { "SysVConsole", config_parse_bool, &arg_sysv_console, "Manager" },
+ { "SysVConsole", config_parse_bool, 0, &arg_sysv_console, "Manager" },
#endif
- { "CrashChVT", config_parse_int, &arg_crash_chvt, "Manager" },
- { "CPUAffinity", config_parse_cpu_affinity, NULL, "Manager" },
- { "MountAuto", config_parse_bool, &arg_mount_auto, "Manager" },
- { "SwapAuto", config_parse_bool, &arg_swap_auto, "Manager" },
- { "DefaultControllers", config_parse_strv, &arg_default_controllers, "Manager" },
- { "DefaultStandardOutput", config_parse_output, &arg_default_std_output, "Manager" },
- { "DefaultStandardError", config_parse_output, &arg_default_std_error, "Manager" },
- { NULL, NULL, NULL, NULL }
+ { "CrashChVT", config_parse_int, 0, &arg_crash_chvt, "Manager" },
+ { "CPUAffinity", config_parse_cpu_affinity, 0, NULL, "Manager" },
+ { "MountAuto", config_parse_bool, 0, &arg_mount_auto, "Manager" },
+ { "SwapAuto", config_parse_bool, 0, &arg_swap_auto, "Manager" },
+ { "DefaultControllers", config_parse_strv, 0, &arg_default_controllers, "Manager" },
+ { "DefaultStandardOutput", config_parse_output, 0, &arg_default_std_output, "Manager" },
+ { "DefaultStandardError", config_parse_output, 0, &arg_default_std_error, "Manager" },
+ { NULL, NULL, 0, NULL, NULL }
};
static const char * const sections[] = {
break;
}
- if (optind < argc) {
- if (getpid() != 1) {
- /* Hmm, when we aren't run as init system
- * let's complain about excess arguments */
+ if (optind < argc && getpid() != 1) {
+ /* Hmm, when we aren't run as init system
+ * let's complain about excess arguments */
- log_error("Excess arguments.");
- return -EINVAL;
+ log_error("Excess arguments.");
+ return -EINVAL;
+ }
- } else if (detect_container(NULL) > 0) {
- char **a;
+ if (detect_container(NULL) > 0) {
+ char **a;
- /* All /proc/cmdline arguments the kernel
- * didn't understand it passed to us. We're
- * note really interested in that usually
- * since /proc/cmdline is more interesting and
- * complete. With one exception: if we are run
- * in a container /proc/cmdline is not
- * relevant for us, hence we rely on argv[]
- * instead. */
+ /* All /proc/cmdline arguments the kernel didn't
+ * understand it passed to us. We're not really
+ * interested in that usually since /proc/cmdline is
+ * more interesting and complete. With one exception:
+ * if we are run in a container /proc/cmdline is not
+ * relevant for the container, hence we rely on argv[]
+ * instead. */
- for (a = argv + optind; a < argv + argc; a++)
- if ((r = parse_proc_cmdline_word(*a)) < 0)
- return r;
- }
+ for (a = argv; a < argv + argc; a++)
+ if ((r = parse_proc_cmdline_word(*a)) < 0)
+ return r;
}
return 0;
/* If Plymouth is being run make sure we show the status, so
* that there's something nice to see when people press Esc */
- if (access("/dev/.run/initramfs/plymouth", F_OK) >= 0)
+ if (access("/run/initramfs/plymouth", F_OK) >= 0)
arg_show_status = true;
if (arg_action == ACTION_HELP) {