diff options
| author | Peter Jones <pjones@redhat.com> | 2008-06-04 12:55:32 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@pjones2.localdomain> | 2008-06-04 12:55:32 -0400 |
| commit | 44ab737bd0929d7d3eeac01ebbcd59916c56471a (patch) | |
| tree | 721a253cc4ea0fe2d30def0aac381e55a9988740 /src/main.c | |
| parent | a47e2686097e88e2ee47075d3ab1cf1b0e671df1 (diff) | |
| download | plymouth-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.c | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -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; } |
