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();
+3 -2
View File
@@ -494,8 +494,9 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
(void) exec_shared_runtime_deserialize_one(m, val, fds);
else if ((val = startswith(l, "subscribed="))) {
if (strv_extend(&m->deserialized_subscribed, val) < 0)
return -ENOMEM;
r = strv_extend(&m->deserialized_subscribed, val);
if (r < 0)
return r;
} else if ((val = startswith(l, "varlink-server-socket-address="))) {
if (!m->varlink_server && MANAGER_IS_SYSTEM(m)) {
r = manager_varlink_init(m);
+1 -1
View File
@@ -3098,7 +3098,7 @@ int service_deserialize_exec_command(
case STATE_EXEC_COMMAND_ARGS:
r = strv_extend(&argv, arg);
if (r < 0)
return -ENOMEM;
return r;
break;
default:
assert_not_reached();