mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-09-19 01:45:00 +03:00
main: let's move the arg_show_status check into status_welcome()
It's kinda nice to hide this check inside of status_welcome() itself, so that it handles all this on its own.
This commit is contained in:
@@ -1338,6 +1338,9 @@ static int status_welcome(void) {
|
|||||||
_cleanup_free_ char *pretty_name = NULL, *ansi_color = NULL;
|
_cleanup_free_ char *pretty_name = NULL, *ansi_color = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
if (arg_show_status <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
r = parse_env_file("/etc/os-release", NEWLINE,
|
r = parse_env_file("/etc/os-release", NEWLINE,
|
||||||
"PRETTY_NAME", &pretty_name,
|
"PRETTY_NAME", &pretty_name,
|
||||||
"ANSI_COLOR", &ansi_color,
|
"ANSI_COLOR", &ansi_color,
|
||||||
@@ -1915,9 +1918,7 @@ static int initialize_runtime(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (arg_system && !skip_setup) {
|
if (arg_system && !skip_setup) {
|
||||||
if (arg_show_status > 0)
|
|
||||||
status_welcome();
|
status_welcome();
|
||||||
|
|
||||||
hostname_setup();
|
hostname_setup();
|
||||||
machine_id_setup(NULL, arg_machine_id, NULL);
|
machine_id_setup(NULL, arg_machine_id, NULL);
|
||||||
loopback_setup();
|
loopback_setup();
|
||||||
|
Reference in New Issue
Block a user