[PATCH weston 19/20] desktop-shell: use the standard 'environ' variable

Pekka Paalanen ppaalanen at gmail.com
Fri Aug 3 04:39:15 PDT 2012


The variable '__environ' seems to be libc implementation specific, and
not avaible on Android.

Use the POSIX standard variable 'environ', which also luckily happens to
be available on Android, which is not POSIX.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 clients/desktop-shell.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 082a30a..97b2066 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -44,6 +44,8 @@
 
 #include "desktop-shell-client-protocol.h"
 
+extern char **environ; /* defined by libc */
+
 struct desktop {
 	struct display *display;
 	struct desktop_shell *shell;
@@ -484,9 +486,9 @@ panel_add_launcher(struct panel *panel, const char *icon, const char *path)
 
 	wl_array_init(&launcher->envp);
 	wl_array_init(&launcher->argv);
-	for (i = 0; __environ[i]; i++) {
+	for (i = 0; environ[i]; i++) {
 		ps = wl_array_add(&launcher->envp, sizeof *ps);
-		*ps = __environ[i];
+		*ps = environ[i];
 	}
 	j = 0;
 
-- 
1.7.8.6



More information about the wayland-devel mailing list