src/activate/activate.c:167:51: warning: declaration shadows a variable in the global scope [-Wshadow]
static int launch(char* name, char **argv, char **environ, int fds) {
^
/usr/include/unistd.h:546:15: note: previous declaration is here
extern char **environ;
^
-static int launch(char* name, char **argv, char **environ, int fds) {
+static int launch(char* name, char **argv, char **env, int fds) {
unsigned n_env = 0, length;
char **envp = NULL, **s;
static const char* tocopy[] = {"TERM=", "PATH=", "USER=", "HOME="};
unsigned n_env = 0, length;
char **envp = NULL, **s;
static const char* tocopy[] = {"TERM=", "PATH=", "USER=", "HOME="};
char _cleanup_free_ *p = strappend(*s, "=");
if (!p)
return log_oom();
char _cleanup_free_ *p = strappend(*s, "=");
if (!p)
return log_oom();
- envp[n_env] = strv_find_prefix(environ, p);
+ envp[n_env] = strv_find_prefix(env, p);
if (envp[n_env])
n_env ++;
}
}
for (i = 0; i < ELEMENTSOF(tocopy); i++) {
if (envp[n_env])
n_env ++;
}
}
for (i = 0; i < ELEMENTSOF(tocopy); i++) {
- envp[n_env] = strv_find_prefix(environ, tocopy[i]);
+ envp[n_env] = strv_find_prefix(env, tocopy[i]);
if (envp[n_env])
n_env ++;
}
if (envp[n_env])
n_env ++;
}
-static int launch1(const char* child, char** argv, char **environ, int fd) {
+static int launch1(const char* child, char** argv, char **env, int fd) {
pid_t parent_pid, child_pid;
int r;
pid_t parent_pid, child_pid;
int r;