chiark / gitweb /
util: don't shadow variable
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sat, 29 Nov 2014 23:37:16 +0000 (00:37 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Wed, 3 Dec 2014 22:51:51 +0000 (23:51 +0100)
environ is already defined in unistd.h

src/shared/util.c

index 4fcbab97bed67eefaeea956708d5cc2d9f916abe..f01cdd7451f9d70f8f13a4e6c4a7229a2bbd692b 100644 (file)
@@ -955,7 +955,7 @@ int get_process_root(pid_t pid, char **root) {
         return get_process_link_contents(p, root);
 }
 
         return get_process_link_contents(p, root);
 }
 
-int get_process_environ(pid_t pid, char **environ) {
+int get_process_environ(pid_t pid, char **env) {
         _cleanup_fclose_ FILE *f = NULL;
         _cleanup_free_ char *outcome = NULL;
         int c;
         _cleanup_fclose_ FILE *f = NULL;
         _cleanup_free_ char *outcome = NULL;
         int c;
@@ -963,7 +963,7 @@ int get_process_environ(pid_t pid, char **environ) {
         size_t allocated = 0, sz = 0;
 
         assert(pid >= 0);
         size_t allocated = 0, sz = 0;
 
         assert(pid >= 0);
-        assert(environ);
+        assert(env);
 
         p = procfs_file_alloca(pid, "environ");
 
 
         p = procfs_file_alloca(pid, "environ");
 
@@ -982,7 +982,7 @@ int get_process_environ(pid_t pid, char **environ) {
         }
 
         outcome[sz] = '\0';
         }
 
         outcome[sz] = '\0';
-        *environ = outcome;
+        *env = outcome;
         outcome = NULL;
 
         return 0;
         outcome = NULL;
 
         return 0;