tree-wide: propagate the error we got from strv_extend_xyz() to the caller

It's a bit sloppy to return -ENOMEM rather than the actual error we
already returned in the first place (even though it's always going to be
ENOMEM)
This commit is contained in:
Lennart Poettering
2024-01-17 11:32:11 +01:00
parent 4212636763
commit 010cd1dc58
6 changed files with 20 additions and 15 deletions
+3 -3
View File
@@ -1949,7 +1949,7 @@ int bus_exec_context_set_transient_property(
r = strv_extend_strv(&c->supplementary_groups, l, true);
if (r < 0)
return -ENOMEM;
return r;
joined = strv_join(c->supplementary_groups, " ");
if (!joined)
@@ -3174,7 +3174,7 @@ int bus_exec_context_set_transient_property(
r = strv_extend_strv(dirs, l, true);
if (r < 0)
return -ENOMEM;
return r;
unit_write_settingf(u, flags, name, "%s=%s", name, joined);
}
@@ -3201,7 +3201,7 @@ int bus_exec_context_set_transient_property(
_cleanup_free_ char *joined = NULL;
r = strv_extend_strv(&c->exec_search_path, l, true);
if (r < 0)
return -ENOMEM;
return r;
joined = strv_join(c->exec_search_path, ":");
if (!joined)
return log_oom();