From: Lennart Poettering Date: Wed, 6 Mar 2019 18:22:33 +0000 (+0100) Subject: systemctl: use strv_consume() where appropriate X-Git-Tag: v242-rc1~131^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96e895efaf7b381e7fab68b7b6c49367634c17d1;p=thirdparty%2Fsystemd.git systemctl: use strv_consume() where appropriate --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 03dea764cc6..a88dd839298 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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; }