mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 01:55:32 +03:00
systemctl: use strv_consume() where appropriate
This commit is contained in:
parent
fb1ac50e4e
commit
96e895efaf
@ -8023,9 +8023,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
if (unit_type_from_string(type) >= 0) {
|
||||
if (strv_push(&arg_types, type) < 0)
|
||||
if (strv_consume(&arg_types, TAKE_PTR(type)) < 0)
|
||||
return log_oom();
|
||||
type = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -8034,9 +8033,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
|
||||
* in --types= too for compatibility
|
||||
* with old versions */
|
||||
if (unit_load_state_from_string(type) >= 0) {
|
||||
if (strv_push(&arg_states, type) < 0)
|
||||
if (strv_consume(&arg_states, TAKE_PTR(type)) < 0)
|
||||
return log_oom();
|
||||
type = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user