Merge pull request #27165 from poettering/fdstore-envvar

service: tell service processes that the fdstore is available via an e…
This commit is contained in:
Luca Boccassi
2023-04-12 12:13:43 +01:00
committed by GitHub
5 changed files with 184 additions and 191 deletions
+5 -1
View File
@@ -1677,7 +1677,7 @@ static int service_spawn_internal(
if (r < 0)
return r;
our_env = new0(char*, 12);
our_env = new0(char*, 13);
if (!our_env)
return -ENOMEM;
@@ -1686,6 +1686,10 @@ static int service_spawn_internal(
return -ENOMEM;
exec_params.notify_socket = UNIT(s)->manager->notify_socket;
if (s->n_fd_store_max > 0)
if (asprintf(our_env + n_env++, "FDSTORE=%u", s->n_fd_store_max) < 0)
return -ENOMEM;
}
if (s->main_pid > 0)