diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-10-11 13:40:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-11 13:40:50 -0400 |
commit | b744e8937ce603090a9bf64ac7d8cc2c1a29e4f0 (patch) | |
tree | d6873059fd870c78dae268671ad0e12ac8c493db /src/core/execute.c | |
parent | 40f45ff0c339971fd088e6f9cc2e61444087685d (diff) | |
parent | a46eac1bbddcdd15e741fc6c8389078db1067f81 (diff) |
Merge pull request #4067 from poettering/invocation-id
Add an "invocation ID" concept to the service manager
Diffstat (limited to 'src/core/execute.c')
-rw-r--r-- | src/core/execute.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index d5c4e60796..7079aeed6e 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1553,10 +1553,11 @@ static int build_environment( unsigned n_env = 0; char *x; + assert(u); assert(c); assert(ret); - our_env = new0(char*, 13); + our_env = new0(char*, 14); if (!our_env) return -ENOMEM; @@ -1627,6 +1628,13 @@ static int build_environment( our_env[n_env++] = x; } + if (!sd_id128_is_null(u->invocation_id)) { + if (asprintf(&x, "INVOCATION_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(u->invocation_id)) < 0) + return -ENOMEM; + + our_env[n_env++] = x; + } + if (exec_context_needs_term(c)) { const char *tty_path, *term = NULL; |