summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2008-06-04 12:55:32 -0400
committerPeter Jones <pjones@pjones2.localdomain>2008-06-04 12:55:32 -0400
commit44ab737bd0929d7d3eeac01ebbcd59916c56471a (patch)
tree721a253cc4ea0fe2d30def0aac381e55a9988740 /src/main.c
parenta47e2686097e88e2ee47075d3ab1cf1b0e671df1 (diff)
downloadplymouth-44ab737bd0929d7d3eeac01ebbcd59916c56471a.tar.gz
plymouth-44ab737bd0929d7d3eeac01ebbcd59916c56471a.tar.xz
plymouth-44ab737bd0929d7d3eeac01ebbcd59916c56471a.zip
Make plymouth_should_be_running() be less manual, and add " init=" handler.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/main.c b/src/main.c
index a491004..a3bf3b5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -415,22 +415,23 @@ plymouth_should_be_running (state_t *state)
{
ply_trace ("checking if plymouth should be running");
- if ((strstr (state->kernel_command_line, " single ") != NULL)
- || (strstr (state->kernel_command_line, "single ") != NULL)
- || (strstr (state->kernel_command_line, " single") != NULL))
- {
- ply_trace ("kernel command line has option 'single'");
- return false;
- }
+ const char const *strings[] = {
+ " single ", " single", "single ",
+ " 1 ", " 1", "1 ",
+ " init=",
+ NULL
+ };
+ int i;
- if ((strstr (state->kernel_command_line, " 1 ") != NULL)
- || (strstr (state->kernel_command_line, "1 ") != NULL)
- || (strstr (state->kernel_command_line, " 1") != NULL))
+ for (i = 0; strings[i] != NULL; i++)
{
- ply_trace ("kernel command line has option '1'");
- return false;
+ if (strstr (state->kernel_command_line, strings[i]) != NULL)
+ {
+ ply_trace ("kernel command line has option \"%s\"", strings[i]);
+ return false;
+ }
}
-
+
return true;
}