summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-28 16:46:06 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-28 17:30:00 +0200
commit24b52437dd3c06bfdbead8f08114e4b6575dea69 (patch)
tree3e726a4abc9c282be871f396273b3fa81b31aedb
parent230f04856647fcfb07d5658f4b8c1cb3557fa0d8 (diff)
fsck: parse kernel cmdline booleans the same ways as the rest
-rw-r--r--src/fsck/fsck.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index 6a0f67f6e9..297ea9efdc 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -73,10 +73,13 @@ static void start_target(const char *target) {
/* 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));
+ log_error("Failed to start unit: %s", bus_error_message(&error, r));
}
static int parse_proc_cmdline_item(const char *key, const char *value) {
+ int r;
+
+ assert(key);
if (streq(key, "fsck.mode") && value) {
@@ -93,12 +96,15 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
if (streq(value, "preen"))
arg_repair = "-a";
- else if (streq(value, "yes"))
- arg_repair = "-y";
- else if (streq(value, "no"))
- arg_repair = "-n";
- else
- log_warning("Invalid fsck.repair= parameter '%s'. Ignoring.", value);
+ else {
+ r = parse_boolean(value);
+ if (r > 0)
+ arg_repair = "-y";
+ else if (r == 0)
+ arg_repair = "-n";
+ else
+ log_warning("Invalid fsck.repair= parameter '%s'. Ignoring.", value);
+ }
}
#ifdef HAVE_SYSV_COMPAT