mirror of
https://github.com/systemd/systemd.git
synced 2025-01-02 01:18:14 +03:00
sd-json: use strv_env_get_merged()
This commit is contained in:
parent
b58c3d4e47
commit
c6cb7141ac
@ -11,6 +11,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "ansi-color.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "ether-addr-util.h"
|
||||
@ -3867,22 +3868,13 @@ _public_ int sd_json_buildv(sd_json_variant **ret, va_list ap) {
|
||||
|
||||
l = va_arg(ap, char **);
|
||||
|
||||
_cleanup_strv_free_ char **el = NULL;
|
||||
STRV_FOREACH_PAIR(x, y, l) {
|
||||
char *n = NULL;
|
||||
if (current->n_suppress == 0) {
|
||||
_cleanup_strv_free_ char **el = NULL;
|
||||
|
||||
n = strjoin(*x, "=", *y);
|
||||
if (!n) {
|
||||
r = -ENOMEM;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = strv_consume(&el, n);
|
||||
r = strv_env_get_merged(l, &el);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (current->n_suppress == 0) {
|
||||
r = sd_json_variant_new_array_strv(&add, el);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
Loading…
Reference in New Issue
Block a user