mirror of
https://github.com/systemd/systemd.git
synced 2025-01-25 10:04:04 +03:00
debug-generator: enclose function call in if statement when retval
is not used
This commit is contained in:
parent
a688e5fefd
commit
b5636a8f83
@ -49,8 +49,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to glob unit name: %m");
|
||||
|
||||
r = strv_consume(&arg_mask, n);
|
||||
if (r < 0)
|
||||
if (strv_consume(&arg_mask, n) < 0)
|
||||
return log_oom();
|
||||
|
||||
} else if (streq(key, "systemd.wants")) {
|
||||
@ -63,11 +62,11 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to glob unit name: %m");
|
||||
|
||||
r = strv_consume(&arg_wants, n);
|
||||
if (r < 0)
|
||||
if (strv_consume(&arg_wants, n) < 0)
|
||||
return log_oom();
|
||||
|
||||
} else if (proc_cmdline_key_streq(key, "systemd.debug_shell")) {
|
||||
|
||||
r = value ? parse_boolean(value) : 1;
|
||||
arg_debug_shell = r != 0;
|
||||
if (r >= 0)
|
||||
@ -76,6 +75,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
return free_and_strdup_warn(&arg_debug_tty, skip_dev_prefix(value));
|
||||
|
||||
} else if (proc_cmdline_key_streq(key, "systemd.default_debug_tty")) {
|
||||
|
||||
if (proc_cmdline_value_missing(key, value))
|
||||
return 0;
|
||||
|
||||
@ -239,8 +239,7 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
|
||||
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
||||
|
||||
if (arg_debug_shell) {
|
||||
r = strv_extend(&arg_wants, "debug-shell.service");
|
||||
if (r < 0)
|
||||
if (strv_extend(&arg_wants, "debug-shell.service") < 0)
|
||||
return log_oom();
|
||||
|
||||
install_debug_shell_dropin();
|
||||
|
Loading…
x
Reference in New Issue
Block a user