From: Zbigniew Jędrzejewski-Szmek Date: Sun, 29 Dec 2013 19:56:09 +0000 (-0500) Subject: acticate: rename --environment to --setenv X-Git-Tag: v209~598 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=892213bf1fd23e48d64a407ece6e10b07bef1926 acticate: rename --environment to --setenv Nspawn has --setenv, and systemd itself accepts systemd.setenv. It is nice to have the same parameter name everywhere. Old name is accepted, but not advertised. --- diff --git a/man/systemd-activate.xml b/man/systemd-activate.xml index d48774d9d..35eec1929 100644 --- a/man/systemd-activate.xml +++ b/man/systemd-activate.xml @@ -119,7 +119,7 @@ along with systemd; If not, see . - + Add this variable to the environment of the launched process. If VAR is diff --git a/src/activate/activate.c b/src/activate/activate.c index cf545d61f..23c484ca9 100644 --- a/src/activate/activate.c +++ b/src/activate/activate.c @@ -38,7 +38,7 @@ static char** arg_listen = NULL; static bool arg_accept = false; static char** arg_args = NULL; -static char** arg_environ = NULL; +static char** arg_setenv = NULL; static int add_epoll(int epoll_fd, int fd) { struct epoll_event ev = { @@ -162,14 +162,14 @@ static int launch(char* name, char **argv, char **env, int fds) { char **s; unsigned i; - length = strv_length(arg_environ); + length = strv_length(arg_setenv); /* PATH, TERM, HOME, USER, LISTEN_FDS, LISTEN_PID, NULL */ envp = new0(char *, length + 7); if (!envp) return log_oom(); - STRV_FOREACH(s, arg_environ) { + STRV_FOREACH(s, arg_setenv) { if (strchr(*s, '=')) envp[n_env++] = *s; else { @@ -302,12 +302,11 @@ static int help(void) { printf("%s [OPTIONS...]\n\n" "Listen on sockets and launch child on connection.\n\n" "Options:\n" - " -l --listen=ADDR Listen for raw connections at ADDR\n" - " -a --accept Spawn separate child for each connection\n" - " -h --help Show this help and exit\n" - " -E --environment=NAME[=VALUE]\n" - " Pass an environment variable to children\n" - " --version Print version string and exit\n" + " -l --listen=ADDR Listen for raw connections at ADDR\n" + " -a --accept Spawn separate child for each connection\n" + " -h --help Show this help and exit\n" + " -E --setenv=NAME[=VALUE] Pass an environment variable to children\n" + " --version Print version string and exit\n" "\n" "Note: file descriptors from sd_listen_fds() will be passed through.\n" , program_invocation_short_name @@ -322,11 +321,12 @@ static int parse_argv(int argc, char *argv[]) { }; static const struct option options[] = { - { "help", no_argument, NULL, 'h' }, - { "version", no_argument, NULL, ARG_VERSION }, - { "listen", required_argument, NULL, 'l' }, - { "accept", no_argument, NULL, 'a' }, - { "environment", required_argument, NULL, 'E' }, + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, ARG_VERSION }, + { "listen", required_argument, NULL, 'l' }, + { "accept", no_argument, NULL, 'a' }, + { "setenv", required_argument, NULL, 'E' }, + { "environment", required_argument, NULL, 'E' }, /* alias */ {} }; @@ -358,7 +358,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'E': { - int r = strv_extend(&arg_environ, optarg); + int r = strv_extend(&arg_setenv, optarg); if (r < 0) return r;