[Tarantool-patches] [PATCH 2/7] popen: allow accessing environ variable

Cyrill Gorcunov gorcunov at gmail.com
Mon Mar 2 23:12:22 MSK 2020


This is part of posix standart.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/lib/core/popen.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
index 1cfe58ee0..0e2d9dd00 100644
--- a/src/lib/core/popen.c
+++ b/src/lib/core/popen.c
@@ -591,9 +591,7 @@ close_inherited_fds(int *skip_fds, size_t nr_skip_fds)
 	return 0;
 }
 
-#ifdef TARGET_OS_LINUX
 extern char **environ;
-#endif
 
 /**
  * Get pointer to environment variables to use in
@@ -603,17 +601,8 @@ static inline char **
 get_envp(struct popen_opts *opts)
 {
 	if (!opts->env) {
-#ifdef TARGET_OS_LINUX
 		/* Inherit existing ones if not specified */
 		return environ;
-#else
-		static const char **empty_envp[] = { NULL };
-		static bool said = false;
-		if (!said)
-			say_warn("popen: Environment inheritance "
-				 "unsupported, passing empty");
-		return (char **)empty_envp;
-#endif
 	}
 	return opts->env;
 }
-- 
2.20.1



More information about the Tarantool-patches mailing list